找回密码
 加入
搜索
查看: 1591|回复: 3

[AU3基础] 判断checkbox勾选后修改后面INPUT为可用,为什么input会一直闪(已解决)

[复制链接]
发表于 2011-1-27 10:11:42 | 显示全部楼层 |阅读模式
本帖最后由 binshiwo 于 2011-1-27 16:41 编辑

如下程序,为什么input会一直闪动。请大家帮忙指点一二。并给个修改思路。

#include<guiconstantsex.au3>
example()
Func example()
        GUICreate("gui example",200,200)
        $checkbox = GUICtrlCreateCheckbox("checked",20,20,90,20)
        $input = GUICtrlCreateInput("",20,90,20,20)
        GUICtrlSetState($input,$gui_disable)
        GUISetState(@SW_SHOW)
While 1
        $msg = GUIGetMsg()
        If $msg = $gui_event_close Then
                Exit
        EndIf
        If BitAND(GUICtrlRead($checkbox),$gui_checked) Then
                GUICtrlSetState($input,$gui_enable)
        Else
                GUICtrlSetState($input,$gui_disable)
        EndIf
WEnd
EndFunc
发表于 2011-1-27 10:31:44 | 显示全部楼层
#include<guiconstantsex.au3>
example()
Func example()
        GUICreate("gui example",200,200)
        $checkbox = GUICtrlCreateCheckbox("checked",20,20,90,20)
        $input = GUICtrlCreateInput("",20,90,20,20)
        GUICtrlSetState($input,$gui_disable)
        GUISetState(@SW_SHOW)
        While 1
                $msg = GUIGetMsg()
                Select
                        Case $msg = $gui_event_close
                                Exit
                        Case $msg = $checkbox
                                If BitAND(GUICtrlRead($checkbox),$gui_checked) Then
                                        GUICtrlSetState($input,$gui_enable)
                                Else
                                        GUICtrlSetState($input,$gui_disable)
                                EndIf
                EndSelect
        WEnd
EndFunc
 楼主| 发表于 2011-1-27 10:39:17 | 显示全部楼层
多谢smartzbs兄指点 。问题解决了
发表于 2011-1-27 13:05:31 | 显示全部楼层
你做成死循环里了,不停运行检测,做成事件就可以了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-10-2 16:24 , Processed in 0.075718 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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