判断checkbox勾选后修改后面INPUT为可用,为什么input会一直闪(已解决)
本帖最后由 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 #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 多谢smartzbs兄指点 。问题解决了 你做成死循环里了,不停运行检测,做成事件就可以了
页:
[1]