If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) ButtonGadget(1,10,30,100,20,"Verstecken",0) If CreateToolBar(0,WindowID(0)) ToolBarStandardButton(0, #PB_ToolBarIcon_New) EndIf Repeat EventID=WaitWindowEvent() If EventID=#PB_Event_Gadget Select EventGadget() Case 1 If Show=0 SetGadgetText(1,"Anzeigen") ShowWindow_(ToolBarID(0),#SW_HIDE) Show=1 Else SetGadgetText(1,"Verstecken") ShowWindow_(ToolBarID(0),#SW_SHOW) Show=0 EndIf EndSelect EndIf Until EventID = #PB_Event_CloseWindow EndIf