Hallo,
ich will, dass in meiner GUI ein Label alle 5 Sekunden aktualisieren wird.
Habe es direkt mit AdlibEnable() probiert, aber es funktioniert nicht.
Das Label soll aber nur dann aktualisiert werden, wenn eine Checkbox gewählt ist.
Hier mein Script:
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Test", 211, 128, 519, 263)
$Input1 = GUICtrlCreateInput("Test", 8, 8, 121, 21)
$Label1 = GUICtrlCreateLabel("Label1", 12, 64, 100, 17)
$Label2 = GUICtrlCreateLabel("Label2", 12, 96, 100, 17)
$Label3 = GUICtrlCreateLabel("Label2", 100, 96, 100, 17)
$Checkbox1 = GUICtrlCreateCheckbox("Label 1 alle 5 Sekunden aktualisieren", 8, 36, 201, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
If GUICtrlRead($Label2) <> GUICtrlRead($Input1) Then GUICtrlSetData($Label2, GUICtrlRead($Input1))
If GUICtrlRead($Label3) <> GUICtrlRead($Input1) Then GUICtrlSetData($Label3, GUICtrlRead($Input1))
If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then
AdlibEnable("_test", 5000)
EndIf
WEnd
Func _test()
If GUICtrlRead($Label1) <> GUICtrlRead($Input1) Then GUICtrlSetData($Label1, GUICtrlRead($Input1))
EndFunc