Button is disabled while textbox is blank
#include <GuiConstantsEx.au3>
$InputWindowHandle = GUICreate("Please provide Input", 225, 125)
GUISetState(@SW_SHOW)
GUICtrlCreateLabel("Please Provide the name of Publisher!", 25, 20)
$PubInput = GUICtrlCreateInput("", 75, 50, 80)
$PubSubmitButton = GUICtrlCreateButton("Submit", 85, 80, 60)
GuiCtrlSetState($PubSubmitButton, $GUI_Disable)
Local $msg4
GUISetState()
Local $Enabled = False
While 1
$msg4 = GUIGetMsg()
If GuiCtrlRead($PubInput) <> "" And $Enabled = False Then
GuiCtrlSetState($PubSubmitButton, $GUI_ENABLE)
$Enabled = True
EndIf
Select
Case $msg4 = $PubSubmitButton
$PubName = GUICtrlRead ($PubInput)
GUIDelete()
Run ('osql -S ' & $PubName & ' -E -i "C:\T-MATRIX\Scripts\DropPublisher.sql"')
IF @error <> 0 Then
MsgBox(1, "Error", "Not able to run script - 'Drop Publisher.sql'")
;Return $RetValue = False
EndIf
sleep (30000)
ExitLoop
Case $msg4 = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
WEnd
edit: better way