#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $Button_1, $Button_2, $nCh1, $Gui, $msg
$Gui = GUICreate("My GUI Button")
Opt("GUICoordMode", 2)
$Button_1 = GUICtrlCreateButton("Первая", 10, 20, 120)
$Button_2 = GUICtrlCreateButton("Вторая", -1, 0)
$nCh1 = GUICtrlCreateCheckbox("Checkbox 1", 10, 10, 120, 20)
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $Button_1
;~ Run('Notepad.exe')
Case $nCh1
If GUICtrlRead($nCh1) = $GUI_UNCHECKED Then
GUICtrlSetState($Button_1, $GUI_ENABLE)
Else
GUICtrlSetState($Button_1, $GUI_DISABLE)
EndIf
;~ Exit
EndSwitch
WEnd
EndFunc ;==>Example