DisableMenuItem()

Syntax

DisableMenuItem(#Menu, MenuItem, State)
Description
Disable (or enable) a menu item in the given menu.

Parameters

#Menu The menu to use.
MenuItem The number of the menu item to disable or enable.
State The new state for the menu item. A value of 1 disables the menu item and a value of 0 enables it.

Return value

None.

Example

  If OpenWindow(0, 200, 200, 200, 100, "DisableMenuItem Example")
    If CreateMenu(0, WindowID(0))
      MenuTitle("Project")
        MenuItem(1, "Open")
        MenuItem(2, "Save")
        DisableMenuItem(0, 2, 1)     ; disable the second menu item (Save)
    EndIf
    
    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf

See Also

MenuItem(), SetMenuItemState(), SetMenuItemText()

Supported OS

All

<- CreatePopupMenu() - Menu Index - DisplayPopupMenu() ->