menuItems

menuItems(menuNumber: Integer): MenuItem;

The menuItems method of the Form class enables logic to access a reference to the menu items on an active form at run time.

This method returns the active menu item object specified in the menuNumber parameter or null if there is no specified menu item. The method returns an object of type MenuItem, which enables the properties of a menu item to be accessed.

The method in the following example examines all menu items on a form.

vars
    mnu  : MenuItem;
    indx : Integer;
begin
    foreach indx in 1 to menuItemCount do
        mnu := menuItems(indx);
        if mnu.name = "Item1" then
            ...                   // do some processing here
        endif;
    endforeach;
end;