TopIndex Property Example
The following example identifies the top item displayed in a ListBox and the item that has the focus within the ListBox. This example uses the TopIndex property to identify the item displayed at the top of the ListBox and the ListIndex property to identify the item that has the focus. The user selects an item in the ListBox. The displayed values of TopIndex and ListIndex are updated when the user selects an item or when the user clicks the CommandButton..
To use this example, copy this sample code to the Declarations portion of a form. Make sure that the form contains:
- A Label named Label1.
- A TextBox named TextBox1.
- A Label named Label2.
- A TextBox named TextBox2.
- A CommandButton named CommandButton1.
- A ListBox named ListBox1.
|