I am trying to build a GUI that will show a checkbox if a particular file exists. If the file does not exist, the checkbox is hidden. The code below sort of works. This is stripped down from a much larger project.
When I run this if a file named test.txt is not on the desktop, no checkbox. If the file is there, then the checkbox appears. However, the checkbox disappears for good as soon as I move my mouse over it or on the same horizontal plane as the checkbox. Hoping someone can help.
;-----------------------------INCLUDES----------------------------------------------------------
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
;------------------------------VARIABLES--------------------------------------------------------
Dim $extrabutton, $adsi, $main, $add_adsi, $select, $msg
;------------------------------MAIN--------------------------------------------------------
Opt('MustDeclareVars', 1)
$main = GUICreate("Purpose", 380, 270)
GUICtrlCreateLabel("Identify the reason", 55, 10)
$select = GUICtrlCreateButton("Select", 145, 230, 90)
$adsi = GUICtrlCreateCheckbox("Enable ADSI",15,190,375)
$extrabutton = GUICtrlCreateCheckbox("Enable sweetness",100,190,375)
GUICtrlSetState($extrabutton,$gui_hide)
If FileExists(@DesktopDir & '\test.txt') Then
GUICtrlSetState($extrabutton,$gui_show)
EndIf
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
GUIDelete()
ExitLoop
Case $msg = $select And GUICtrlRead($adsi) = $GUI_CHECKED
$add_adsi = True
ContinueCase
EndSelect
WEnd