Web Popup Menu
From Xojo Documentation
Popup Menu controls are useful when you have a single list of data to present in a limited amount of space. It presents a list of items from which the user can choose one item.
You can add values to the Popup Menu by using the Set Default Value button on the toolbar, clicking the Pencil icon when hovering over the control or pressing Return while the control is selected.
Below are a list of commonly used events, properties and methods. Refer to WebPopupMenu in the Language Reference for the complete list.
- Called when the selected item in the popup menu has changed.
- This property takes one parameter, an index of the row. It returns the text of the item in the popup menu specified by the index parameter. If the index does not exist, then an OutOfBoundsException is raised.
ListCount As Integer
- An Integer containing the number of rows in the popup menu.
ListIndex As Integer
- An Integer used to get or set the currently selected row in the popup menu.
Text As String
- Contains the text of the currently selected row.
- Takes as a parameter a string or an array of strings to add a row or rows to the popup menu.
- Removes all rows from the popup menu.
- Returns the row number in the list of the supplied value.
- Takes as a parameter the row and name of item to insert into the popup menu.
- Takes as a parameter the number of the row to remove.
- Takes as a parameter the number of the row to which to assign the tag. The tag can be any value or class (variant).
This code in the Shown event handler populates a Popup Menu:
This code in the SelectionChanged event handler displays the selected direction:
This could also be written more simply as: