Just wanting an opinion or suggestions if there is an easier or better way to perform this Case. It essentially toggles 1 button as a start and stop button and performs actions based on the state of the button at the time of being clicked.
Thanks for any additions/suggestions.
Case $btnStart
If _GUICtrlButton_GetText($btnStart) = "Start" And FileExists("C:\logdir") Then
GUICtrlSetState($btnUpload, $GUI_DISABLE)
GUICtrlSetData($lblDir, "Templates: " & $count[1] - 1)
EndIf
DirCreate("C:\logdir")
If _GUICtrlButton_GetText($btnStart) = "Start" Then
GUICtrlSetData($btnStart, "Stop")
GUICtrlSetData($lblDesc, $descRun)
GUICtrlSetState($lblDir, $GUI_SHOW)
GUICtrlSetState($btnScan, $GUI_ENABLE)
Else
GUICtrlSetData($btnStart, "Start")
GUICtrlSetState($btnUpload, $GUI_ENABLE)
GUICtrlSetData($lblDesc, $descStop)
If $count = 0 Then
GUICtrlSetState($btnUpload, $GUI_DISABLE)
GUICtrlSetState($btnScan, $GUI_DISABLE)
GUICtrlSetData($lblDesc, @CR & "No templates have been collected, please press the Start button and try again")
Else
GUICtrlSetState($btnScan, $GUI_DISABLE)
GUICtrlSetData($lblDir, "Templates: " & $count[1] - 1)
EndIf
Attachment()
EndIf