angepasst. Guck Dir den Code mal genauer an.
Code: Alles auswählen
; PureBasic Visual Designer v3.95 build 1485 (PB4Code)
;statt der IncludeDatei habe ich es in den Hauptcode reinkopiert
;- Window Constants
;
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
;
Enumeration
#Button_0
#Button_1
#Button_2
EndEnumeration
Procedure Open_Window_0()
If OpenWindow(#Window_0, 216, 0, 332, 122, "Mein Fenster", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
ButtonGadget(#Button_0, 20, 20, 60, 30, "OK")
ButtonGadget(#Button_1, 100, 20, 60, 30, "Oho")
ButtonGadget(#Button_2, 170, 20, 80, 30, "Ende")
EndIf
EndIf
EndProcedure
Open_Window_0() ;hier wird das Fenster geöffnet
Repeat ; Start of the event loop ; Ereignisbehandlungsroutinen
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
;You can place code here, and use the result as parameters for the procedures
If Event = #PB_Event_Gadget
If GadgetID = #Button_0
MessageRequester("aha","Ok gedrückt",0)
ElseIf GadgetID = #Button_1
MessageRequester("so","Du hast den mittleren Knopf gedrückt",0)
ElseIf GadgetID = #Button_2
MessageRequester("so","Ende",0)
End
EndIf
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
MessageRequester("Kreuzchen","So macht man auch Schluss",0)
End
;