Sign in to follow this  
Followers 0
EliTe_ThuT

Checkbox

8 posts in this topic

#1 ·  Posted (edited)

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



#2 ·  Posted (edited)

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

#4 ·  Posted (edited)

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

#5 ·  Posted (edited)

Edit: Too slow

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

Edited by monoceres

Broken link? PM me and I'll send you the file!

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

Working !

It's because I was using the template generated by GuiBuilder...which is not the same as the one you gave me. Thanks

Share this post


Link to post
Share on other sites

Your welcome. Glad you got it working.

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  
Followers 0