List                                                                                                                 Object

A LIST object is a box on the form where multiple text strings (items) can be displayed with each text string (item) on a separate line. One item of the list may be highlighted (selected) and is printed in reverse colors with white letters on a black background. The box area is only big enough to display a few items. If there are more items than there is room to display, there is a scrollbar along the right side of the list box to allow up/down scrolling. The Selected method is set before the list code is run, while the Text is set afterwards.

 

List contents may be set at design time by filling in the list box that appears by clicking on the List property. List contents may also be set at execution time using the Add method. The best place to do this is in the form's After Code for the form on which the list object appears. Use the NODISPLAY option to keep the form from refreshing each time you add an item.  Set .Selected to 0 to not select any item. The hide and show methods do not work properly prior to Palm OS 3.5.

 

Properties Supported (Set at design time)

Font ID, Visible Items, Visible, List

 

Methods Supported (See "Methods")

Left, Top, Width, Hide, Show, Redraw, Add, Remove, Clear, Text, Selected, NoItems, ID, Index, Type

 

Example

Dim ItemsOnList as Integer

Dim selectedname as String

ListCity.clear 'always clear the list first

ListCity.add "New York",NODISPLAY'delay form update

ListCity.add "Boston",NODISPLAY   'delay form update

ListCity.add "New Orleans"        'now, update form

ListCity.selected=2 ' Highlight Boston

ListCity.remove 3 'Delete New Orleans

ItemsOnList=ListCity.NoItems 'get items on list

selectedName= ListCity.text(ListCity.selected)

ListCity.clear