EnableExplicit Define EventID If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) If CreateMenu(1,WindowID(0)) MenuTitle("Datei") MenuItem(1,"Item",0) EndIf ButtonGadget(1,10,10,100,20,"Menü entfernen",0) Repeat EventID=WaitWindowEvent() If EventID=#PB_Event_Gadget Select EventGadget() Case 1 SetMenu_(WindowID(0),0) EndSelect EndIf Until EventID = #PB_Event_CloseWindow EndIf