Spoiler anzeigen
[autoit]
#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
Global $cButton[3]
GUICreate("Test", 100, 200)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
$cButton[0] = GUICtrlCreateButton("Button 1", 20, 20)
GUICtrlSetOnEvent(-1, "_EventHandler")
GUISetState()
While 1
Sleep(100)
WEnd
; Wie komme ich jetzt nach dem Button hierher???
Func _EventHandler()
Switch @GUI_CtrlId
Case $cButton[0]
MsgBox(0, "", "Button 1 gedrückt")
_Exit()
EndSwitch
EndFunc ;==>_EventHandler
Func _Exit()
Exit
EndFunc ;==>_Exit