Home > Language Reference > Classes > ChoiceControl
Change Event
Event raised when a new item is selected in the list.
Syntax
Public Event Change()
Remarks
The Change event is raised when the user selects a new element in the list displayed by the control.
From its event handler, you can determine the element selected by consulting the value of the ListIndex property. You can also determine the heading or associated value of this element using the List and ItemData properties.
The following example fills a list with the digits 0 to 9, and displays a message box when the user selects an element:
Private Sub Form_Load()
Dim i as Integer
List1.Redraw = False
For i = 0 To 9
List1.AddItem "Item #" & CStr(i), i
Next i
List1.Redraw = True
End Sub
Private Sub List1_Change()
Dim k as Integer
k = List1.ListIndex
If k>=0 Then
MsgBox "Selected Item : " & List1.ItemData(k)
Else
MsgBox "No selection"
End If
End SubNote: this event is not raised when the selection is programmatically modified with the ListIndex property.
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | N/A |