Hallo
Wenn ich im unten angefügten Script den Button "Label da" zweimal anklicke ohne mal "Label weg" gedrückt zu haben wird die Variable irgendwie gehalten und kann nicht mehr gelöscht werden. Hat jemand ne Lösung ? Ich hab keine Idee wieso das so ist. ![]()
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Local $Lab
$Form1 = GUICreate("Test", 486 , 330 , 400 , 183 , $WS_MAXIMIZEBOX)
$OTC = GUICtrlCreateButton("Label da", 40, 50, 145, 33)
$BTC = GUICtrlCreateButton("Label weg", 280, 50, 153, 33)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $OTC
_set()
Case $BTC
_del()
EndSwitch
WEnd
Func _del()
GUICtrlDelete($Lab)
EndFunc
Func _set()
$Lab = GUICtrlCreateLabel("Ich bin das Label" , 40 , 108 , 390 , 140)
GUICtrlSetFont(-1, 54, 900, 150, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xAAFF00)
EndFunc