[解决] 如何判断按钮是否可以点击
本帖最后由 wilask 于 2013-12-2 09:45 编辑情景:有时点击了一个按钮后,该按钮变成灰色;
问题:如何判断该按钮已经变成灰色了? 大神,都没有遇到这种情况吗? #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
是这样么 {:face (361):}用GUICtrlSetState抓状态就行了 回复 3# 872777825
谢谢指点,我试试 {:face (245):}建议看看帮助文件,就看Gui就够了 回复 6# Ycxw2008
好的,谢谢。
页:
[1]