You can present information to the user in simple lists with scrollbars. Depending on how you design your application, the user can select one or more list items to perform an action, based on the list selection.
You add ListBox controls to windows in the same way you add other controls: select ListBox from the Insert>Control menu and click the window.
In the painter To add new items, use the control’s Items property page.
To add items to a ListBox:
Select the Items tab in the Properties view for the control.
Enter the names of the items for the ListBox.
In a script Use the AddItem and InsertItem functions to dynamically add items to a ListBox 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 |
Item name Position in which the item will be inserted |
AddItem |
Item name |
For example, this script adds items to a ListBox:
This.AddItem ("Vaporware")
This.InsertItem ("Software",2)
This.InsertItem ("Hardware",2)
This.InsertItem ("Paperware",2)