Hallo,
wie kann ich den Label-Text ausgeben, wenn ich per Kontext-Menü auf "TEST" klicke? (siehe Beispiel:)
C
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
$MainGUI = GUICreate("", 250, 250)
$Button = GUICTRLCreateButton("TEST",20,220,100,20)
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
$arLabels=_CreateLabel()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button
EndSwitch
WEnd
Func _CreateLabel()
local $Array[10]
for $i = 0 to UBound($Array)-1 step 1
$Array[$i]=GUICTRLCreateLabel("Test" & $i, 20,20*$i,200,15)
GUICtrlSetBkColor(-1,0x0B610B)
$context = GUICtrlCreateContextMenu($Array[$i])
$context_test = GUICtrlCreateMenuItem("TEST",$context)
GUICtrlSetOnEvent(-1, "_TEST")
Next
return $Array
EndFunc
func _Exit()
Exit
EndFunc
func _Test()
msgbox(0,"","TEXT?!")
EndFunc
Alles anzeigen