Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <GUIConstantsEx.au3>
- Opt("GUIOnEventMode", 1) ;On Event Modus anschalten. GuiGetMsg Funktioniert jetzt nicht mehr !
- GUICreate("GUI1", 245, 163, 0, 0)
- GUISetOnEvent($GUI_EVENT_CLOSE,"_Exit") ;Event Registrieren (Rotes Kreuz oben)
- GUICtrlCreateButton("Button1", 80, 40, 75, 25)
- GUICtrlSetOnEvent(-1,"_Button1") ;Event für Button 1 (Wenn man bei Control ID -1 angibt dann nimmt er die ID des zuletzt erstellten Controls)
- GUISetState(@SW_SHOW)
- GUICreate("GUI2", 245, 163, 250, 0)
- GUISetOnEvent($GUI_EVENT_CLOSE,"_Exit");Event Registrieren (Rotes Kreuz oben)
- GUICtrlCreateButton("Button2", 80, 40, 75, 25)
- GUICtrlSetOnEvent(-1,"_Button2") ;7
- GUISetState(@SW_SHOW)
- While Sleep(50) ;Damit autoit nicht einfach ausgeht
- WEnd
- Func _Button2()
- MsgBox(0, "", "Button 2 wurde gedrückt")
- EndFunc ;==>_Button2
- Func _Button1()
- MsgBox(0, "", "Button 1 wurde geklickt")
- EndFunc ;==>_Button1
- Func _Exit()
- Exit
- EndFunc ;==>_Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement