ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / List Box functions
  • Displaying an element at the beginning of a List Box control (syntax 1)
  • Limitations
  • Miscellaneous
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Displays a List Box or ListView control from a specified element or returns the index of the first element displayed in a List Box control (if the scrollbar was used).
Remark: ListPosition can be used on:
  • List Box controls based on a data file or populated programmatically,
  • single-selection or multi-selection List Box controls.
WEBDEV - Server code This function has no effect.
Example
// Index of the first element displayed in "LIST_CustomerList"
ResPosition = ListPosition(LIST_CustomerList)
Syntax

Displaying a List Box control from a specified element Hide the details

ListPosition(<List Box control> , <Element index>)
<List Box control>: Control name
Name of the List Box control to be used.
If this parameter corresponds to an empty string (""), the element is displayed at the beginning of the List Box control to which the current event belongs.
<Element index>: Integer
Index of the element to be displayed at the beginning of the List Box control.
A WLanguage error occurs if this parameter is greater than the number of elements found in the List Box control (returned by ListCount).
If this parameter is equal to 1, the List Box control is repositioned at the beginning.

Getting the index of the first element displayed in a List Box or Combo Box control Hide the details

<Result> = ListPosition(<List Box control>)
<Result>: Integer
Index of the first element displayed in the specified List Box control.
<List Box control>: Control name
Name of the List Box control to be used.
If this parameter corresponds to an empty string (""), the index of the first element in the List Box control to which the current event belongs is returned.
Remarks

Displaying an element at the beginning of a List Box control (syntax 1)

The element displayed at the beginning of the List Box control may differ from the desired element. ListPosition positions the element that allows to display a maximum of rows at the beginning of the control. If there are not enough elements displayed below the specified element, this element cannot be displayed at the beginning of the control.
For example, the "Smith Jimmy" element cannot be displayed at the beginning of the List Box control: there arre not enough elements displayed below this element.

Limitations

ListPosition cannot be used on List Box controls based on a data file in "manual" mode that use a bouncing scrollbar.
Reminder:
  • A List Box control based on a data file in "manual" mode is a List Box control programmatically linked to a data file.
  • With a bouncing scrollbar, you can make the scrollbar scroll by keeping the mouse button pressed on the scrollbar button or by keeping the arrow keys (top or down arrow) pressed.

Miscellaneous

  • To display an element at the beginning of a Table control or to get the index of the first element displayed in a Table control, use TablePosition.
  • ListPosition can be used on a "Combo Box" table column.
Component: wd290obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/07/2022

Send a report | Local help