Jump to content
Sign in to follow this  
EliTe_ThuT

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

Share this post


Link to post
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

Share this post


Link to post
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
It still flashes...

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Edit: Too slow

Edit2: Nice to see the nick 'Swift' back again :D

Yeah, I was tired of being R6V2... (Rainbow 6 Vegas 2)

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...