DisableToolBarButton()
Syntax
DisableToolBarButton(#ButtonID, State)Description
Disable or enable the given toolbar button: if 'State' is 0, the button is enabled, if State is 1, the button is disabled.
Example:If OpenWindow(0, 0, 0, 150, 60, #PB_Window_SystemMenu |#PB_Window_ScreenCentered, "ToolBar") If CreateToolBar(0, WindowID()) ToolBarStandardButton(0, #PB_ToolBarIcon_New) ToolBarStandardButton(1, #PB_ToolBarIcon_Open) ToolBarStandardButton(2, #PB_ToolBarIcon_Save) DisableToolBarButton(1,1) : Disabled = #True EndIf If CreateGadgetList(WindowID()) ButtonGadget(0,20,30,110,20,"Enable OpenFile") EndIf Repeat EventID = WaitWindowEvent() If EventID = #PB_Event_Gadget If EventGadgetID() = 0 If Disabled = #True DisableToolBarButton(1,0) SetGadgetText(0,"Disable OpenFile") Disabled = #False Else DisableToolBarButton(1,1) SetGadgetText(0,"Enable OpenFile") Disabled = #True EndIf EndIf EndIf Until EventID = #PB_Event_CloseWindow EndIf
Supported OS
Windows, Linux, MacOS X