Jump to content

Checkbox


Recommended Posts

Hi,

I have a checkbox button and an input field. I want the input to be disabled when the checkbox isn't checked, and enabled when it is.

What I am using is a GUICtrlRead in a while 1 loop... when it returns 1, I use GUICtrlSetState to set state to enabled...but I'm sure there is a better way of doing this, cause with this way, the input flickers a lot...

Thanks

Edited by EliTe_ThuT
Link to comment
Share on other sites

Add this inside your loop:

Case $Checkbox
If GUICtrlRead($Checkbox) = $GUI_UNCHECKED Then
GUICtrlSetState($Input, $GUI_DISABLE)
Else
GUICtrlSetState($Input, $GUI_ENABLE)
EndIf
Edited by Swift
Link to comment
Share on other sites

Ugh, No, It shouldn't. Does your loop look somewhat like this?

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $CheckBox
If GUICtrlRead($Checkbox) = $GUI_UNCHECKED Then
GUICtrlSetState($Input, $GUI_DISABLE)
Else
GUICtrlSetState($Input, $GUI_ENABLE)
EndIf
EndSwitch
WEnd
Edited by Swift
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...