找回密码
 加入
搜索
查看: 3842|回复: 6

[网络通信] [解决] 如何判断按钮是否可以点击

  [复制链接]
发表于 2013-11-29 09:29:49 | 显示全部楼层 |阅读模式
本帖最后由 wilask 于 2013-12-2 09:45 编辑

情景:有时点击了一个按钮后,该按钮变成灰色;
问题:如何判断该按钮已经变成灰色了?
 楼主| 发表于 2013-11-29 13:43:34 | 显示全部楼层
大神,都没有遇到这种情况吗?
发表于 2013-11-29 15:04:56 | 显示全部楼层
#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
是这样么
发表于 2013-11-29 15:48:43 | 显示全部楼层
用GUICtrlSetState抓状态就行了
 楼主| 发表于 2013-11-29 15:54:46 | 显示全部楼层
回复 3# 872777825


    谢谢指点,我试试
发表于 2013-11-29 19:26:49 | 显示全部楼层
建议看看帮助文件,就看Gui就够了
 楼主| 发表于 2013-12-2 09:45:03 | 显示全部楼层
回复 6# Ycxw2008


    好的,谢谢。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-28 21:55 , Processed in 0.076267 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表