PopupMenu (function)

Syntax

PopupMenu(MenuItems$())

Description

Displays a pop-up menu containing the specified items, returning an Integer representing the index of the selected item.

Comments

If no item is selected (that is, the pop-up menu is canceled), then a value of 1 less than the lower bound is returned (normally, –1).

This function creates a pop-up menu using the string elements in the given array. Each array element is used as a menu item. A zero-length string results in a separator bar in the menu.

The pop-up menu is created with the upper left corner at the current mouse position.

A runtime error results if MenuItems$ is not a single-dimension array.

Only one pop-up menu can be displayed at a time. An error will result if another script executes this function while a pop-up menu is visible.

Example

Sub Main()

  Dim a$()

  AppList a$

  w% = PopupMenu(a$)

End Sub

See Also

SelectBox (function).

More information

P