PopUp                                                                                                           Object

 

A POPUP object displays a text label with a graphic element [down-triangle] on its left. When tapped, multiple text strings (items) are displayed with each text string (item) on a separate line. One item in the list may be highlighted (selected) and will be printed in reverse video (white letters on a black background). The box size is set at compilation-time (cannot be changed during program execution), and when not large enough to display all items will contain page-up/page-down controls. List contents may be entered at design time in the List property, or at execution time using the .Add method. The best place to do this is in the form's "After" code. The Selected method is used to identify the selected item in the list. The Text method is used to set the text. The text may differ from the selected item until the Redraw method is used.

 

Properties Supported (Set at design time)

Label, Font ID, Anchor Left, Visible, List

 

Methods Supported (See "Methods")

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

 

Example

 

Dim ItemsInList as Integer

Dim selectedName as String

 

'clear the list and populate it - do in Form After code

 

PopListCity.Clear                    

 

PopListCity.Add "New York" 'Populate the list

PopListCity.Add "Boston"

PopListCity.add "New Orleans"

PopListCity.Selected=2                'Select item#2 (Boston)

PopListCity.Text="What City?"            'Set text

PopListCity.Redraw                       'Show selected item in text

PopListCity.Remove 3                     'Delete item#3 (New Orleans)

ItemsInList=PopListCity.NoItems          'Get number items in list

selectedName=PopListCity.ItemText(PopListCity.Selected) ' get text of currently selected item.