Home > Language Reference > Classes
List Class
+ Object
+ Display
+ UIComponent
+ Control
+ ChoiceControl
+ List
Description
The List class implements the behaviors specific to List controls. A list is a control that offers a choice of several elements to the user. This class is not instantiable, derivable or cloneable. The only instances available to the programmer are those automatically generated by HB++ when you place a control on a form.

All the methods necessary for manipulating elements displayed by the list are defined by the ChoiceControl parent class. Refer to the documentation of this class for more examples of its use.
When the number of elements in the list is greater than the height of the control, scrolling arrows automatically appear in the top and bottom right corners of the control. The EnsureVisible method and the TopItem property allow to control programatically which elements are to be displayed.
The Font property sets at design time the font used to display elements in a list. Contrary to other controls, it is not possible to change this font at runtime.
Finally, the Popup function displays a list, waits until the user chooses an element, hides the list and returns the index of the element selected. This function is used internally to display the list associated with a control of type Popup, but you can also use your own lists. The MiniBrowser sample illustrates how to use this method to implement a list showing the last values input in a field (see cmdList_Click event in frmOpen form).
Members
| Members | Description |
| EnsureVisible | Ensures that an element is visible by scrolling - if necessary - the contents of the list. |
| Font | Font used to display list elements. |
| Popup | Displays the list in a modal window. |
| TopItem | Index of the first visible element in a list. |
| Inherited from ChoiceControl | Description |
| AddItem | Adds an item to a list. |
| Change | Event raised when a new item is selected in the list. |
| Clear | Deletes all the items in a list. |
| FindItemData | Finds an item in a list from its value. |
| FindString | Finds an item in a list from its caption. |
| ItemData | Value associated with a list item. |
| List | Caption of an item in a list. |
| ListCount | Number of items in a list. |
| ListIndex | Item selected in a list. |
| NewIndex | Index of the last inserted item. |
| Redraw | Determines whether the control is updated each time the list is modified. |
| RemoveItem | Deletes an item. |
| Sorted | List elements sort criteria. |
| SortItems | Event raised when the control must compare two items. |
| Inherited from Control | Description |
| DrawFocusRing | Draws the focus ring. |
| GotFocus | Event raised when the control gains the focus. |
| Layer | Layer to which the control belongs. |
| LostFocus | Event raised when the control loses the focus. |
| NavFlags | Navigation flags for the control. |
| RemoveFocusRing | Erase the focus ring. |
| Tag | String associated with the control. |
| Visible | Indicates if a control is visible or not. |
| Inherited from UIComponent | Description |
| ComponentToScreen | Converts coordinates relative to a component into coordinates relative to the screen. |
| FiveWayNavigator | Event raised when the user presses one of the 5-way navigator keys. |
| Height | Element height. |
| Left | Distance between the left edge of the form and the left edge of the element. |
| Move | Moves or resizes an element. |
| PenDown | Event raised when the user touches an UI element with the stylus. |
| PenMove | Event raised when the user moves the stylus. |
| PenUp | Event raised when the user releases the stylus. |
| ScreenToComponent | Converts coordinates relative to the screen into coordinates relative a component. |
| Top | Distance between the top edge of the form and the top edge of the element. |
| UIRef | Internal reference to a control. |
| Width | Element width. |
| Inherited from Display | Description |
| Arc | Draws an arc. |
| BackColor | Background color. |
| BatchLimit | Size of the graphics instruction buffer. |
| CoordinateSystem | Coordinates system. |
| CopyArea | Efficiently copies part of a Display object to another. |
| DrawFont | Font used to draw the text. |
| Flush | Empties the graphics instruction buffer. |
| FontMetrics | Returns a FontMetrics object describing the physical charateristics of the currently active font. |
| ForeColor | Foreground color. |
| GetPixel | Queries the color of a given pixel. |
| hWin | Returns the window handle. |
| Line | Draws a line. |
| Oval | Draws a circle or ellipse. |
| Pattern | Defines the pattern used to fill drawings. |
| Polygon | Draws a polygon. |
| PutPixel | Sets the color of a pixel. |
| Rectangle | Draw a rectangle. |
| ResID | Identifier of the resource associated with the object. |
| ScaleFont | Enable or disable font scaling. |
| TextColor | Text color. |
| TextOut | Draw text. |
| Inherited from Object | Description |
| ClassID | Returns the type identifier corresponding to the actual class of the object. |
| Implements | Determines whether the object implements the features of a given class. |
| Iterate | Event raised to iterate over the elements of a container object. |
| Recipient | Recipient of events sent by the object. |
| Serialize | Event raised to serialize the object content into a stream. |
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | N/A |