MenuFirst

[property icon] MenuFirst

Get first menu item

Read-only Runtime-only OBJECT reference property

Applies to: Menu

Introduced in KCML version 6.20


>

MenuFirst

The MenuFirst property returns the first menu item of a menu control as an object. It may be used in conjunction with MenuNext to programmatically move through the menu items on a menu control. Note that there is a single list of all the menu items, without regard to how they are displayed with submenus etc.

This example enumerates all the items on the menu, calling 'ProcessMenuItem() for each one.

LOCAL DIM OBJECT m
OBJECT m = .mnuControl1.MenuFirst
WHILE (OBJECT m <> NULL)
    'ProcessMenuItem(OBJECT m)
    OBJECT m = m.MenuNext
WEND

See also

Menu methods, properties and events.