Drop-down lists are another way to present simple lists of information to the user. You add DropDownListBox controls to windows in the same way you add other controls: select DropDownListBox from the Insert>Control menu and click the window.
In the painter Use the Items property page for the control to add items.
To add items to a DropDownListBox or DropDownPictureListBox:
Select the Items tab in the Properties view for the control.
Enter the name of the items for the ListBox.
In a script Use the AddItem and InsertItem functions to dynamically add items to a DropDownListBox at runtime.
AddItem adds items to the end of the list. However, if the list is sorted, the item will then be moved to its position in the sort order. Use InsertItem if you want to specify where in the list the item will be inserted.
Function |
You supply |
---|---|
InsertItem |
|
AddItem |
|
This example inserts three items into a DropDownListBox in the first, second, and third positions:
This.InsertItem ("Atropos", 1)
This.InsertItem ("Clotho", 2)
This.InsertItem ("Lachesis", 3)