DisableMenuItem()

Syntax

DisableMenuItem(MenuItem, State)
Description
Disable or enable all the menu items with the 'MenuItem' identifier. If the State is 1, the menu items are disabled. If the State is 0, the menu items are enabled.

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

Supported OS

All

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