Hey, wie kann ich mir von AutoIT ausgeben lassen, welcher von meinen Buttons gedrückt wurde ?
Bei Case $Button_Ctrl[0] To $Button_Ctrl[2] soll mir AutoIT sagen, welcher von den 3 Buttons gedrückt wurde und mir als Msgbox den Text des Buttons ausgeben.
C
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $Button_Ctrl[3]
Global $Button_Name[3]
$Button_Name[0] = "Test1"
$Button_Name[1] = "Test2"
$Button_Name[2] = "Test3"
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 449, 192, 114)
For $i = 0 To 2
$Button_Ctrl[$i] = GUICtrlCreateButton($Button_Name[$i], 104, 40+40*$i, 75, 25)
Next
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button_Ctrl[0] To $Button_Ctrl[2]
EndSwitch
WEnd
Alles anzeigen