EliTe_ThuT Posted April 10, 2008 Share Posted April 10, 2008 (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 April 10, 2008 by EliTe_ThuT Link to comment Share on other sites More sharing options...
Swift Posted April 10, 2008 Share Posted April 10, 2008 (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 April 10, 2008 by Swift Link to comment Share on other sites More sharing options...
EliTe_ThuT Posted April 10, 2008 Author Share Posted April 10, 2008 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... Link to comment Share on other sites More sharing options...
Swift Posted April 10, 2008 Share Posted April 10, 2008 (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 April 10, 2008 by Swift Link to comment Share on other sites More sharing options...
monoceres Posted April 10, 2008 Share Posted April 10, 2008 (edited) Edit: Too slow Edit2: Nice to see the nick 'Swift' back again Edited April 10, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Swift Posted April 10, 2008 Share Posted April 10, 2008 Edit: Too slowEdit2: Nice to see the nick 'Swift' back again Yeah, I was tired of being R6V2... (Rainbow 6 Vegas 2) Link to comment Share on other sites More sharing options...
EliTe_ThuT Posted April 10, 2008 Author Share Posted April 10, 2008 Working ! It's because I was using the template generated by GuiBuilder...which is not the same as the one you gave me. Thanks Link to comment Share on other sites More sharing options...
Swift Posted April 10, 2008 Share Posted April 10, 2008 Your welcome. Glad you got it working. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now