#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 435, 211)
$Button1 = GUICtrlCreateButton("Button1", 56, 80, 75, 25)
$Button2 = GUICtrlCreateButton("Button2", 248, 72, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSetState($Button1, $gui_disable)
MsgBox(0,"","我变成了灰色")
Case $Button2
If GUICtrlGetState($Button1) <> 80 Then
MsgBox(0,"","$Button1处于禁用状态")
Else
MsgBox(0,"","$Button1没有变成灰色")
EndIf
EndSwitch
WEnd
是这样么 |