Condividi tramite


PUSH MENU Command

Places a menu bar definition in a stack of menu bar definitions in memory.

PUSH MENU MenuBarName

Parameters

  • MenuBarName
    Specifies the name of the menu bar whose definition is placed on the stack. The menu bar can be user-defined or the Visual FoxPro system menu bar.

Remarks

When used with POP MENU, PUSH MENU makes it possible for you to save a menu bar definition, make changes to the menu bar definition, and then restore the menu bar definition to its original state.

Menu bar definitions are placed on and removed from the stack in last-in, first-out order. Menu definitions take up memory, so every PUSH MENU should have a corresponding POP MENU to make sure your application's memory usage does not grow unnecessarily.

Example

In the following example, the Visual FoxPro system menu bar is pushed to the stack and then modified. The original system menu bar is then restored by popping it off the stack.

WAIT WINDOW 'Press a key to push the system menu bar'
PUSH MENU _MSYSMENU
WAIT WINDOW 'Press a key to change the system menu bar'
SET SYSMENU TO _MFILE, _MEDIT
WAIT WINDOW 'Press a key to restore the system menu bar'
POP MENU _MSYSMENU

See Also

ACTIVATE MENU | DEFINE MENU | SET SYSMENU