lyledg Posted November 25, 2004 Share Posted November 25, 2004 Guys.. Still learning heaps so apologies for the dumbass question.. I am trying to enable a input box, (which is intially set disabled) through a checkbox.. Basically, If a user chooses the checkbox, the input box should get enabled to accept text.. I know this is simple enough, just been coding all day and not seeing the answer right now... Cheers! Link to comment Share on other sites More sharing options...
jpm Posted November 25, 2004 Share Posted November 25, 2004 Guys..Still learning heaps so apologies for the dumbass question..I am trying to enable a input box, (which is intially set disabled) through a checkbox..Basically, If a user chooses the checkbox, the input box should get enabled to accept text..I know this is simple enough, just been coding all day and not seeing the answer right now...Cheers! <{POST_SNAPBACK}>GUICtrlSetState($id,$GUI_ENABLE) Link to comment Share on other sites More sharing options...
lyledg Posted November 25, 2004 Author Share Posted November 25, 2004 (edited) Thanks, i have already done this, but still not working..Here is my code this far:expandcollapse popupGlobal $LOGFILLOC = GUICtrlCreateInput ("", 30, 195 , 300, 20) GUICtrlSetState(-1,$GUI_ACCEPTFILES)GUICtrlSetState(-1,$GUI_DISABLE)$LOG = GUICtrlCreateCheckbox ("/LOG :: Output status to LOG file (overwrite existing log)", 25, 400, 300, 20)While 1 $msg = GUIGetMsg() If GUIRead($LOG) = $GUI_CHECKED Then GUICtrlSetState ($LOGFILLOC, $GUI_ENABLED) Else EndIf EndIf[code=auto:0]When using this, I get an error saying I have not defined $LOGFILLOC as a variable. But I have declared this as a Global variable already, what am I doing wrong?CheersSee attachment Edited November 25, 2004 by lyledg Link to comment Share on other sites More sharing options... SlimShady Posted November 25, 2004 SlimShady Active Members 2.3k AutoIt lover Share Posted November 25, 2004 (edited) This should work: #include <GUIConstants.au3> Global $LOGFILLOC = GUICtrlCreateInput ("", 30, 195 , 300, 20) GUICtrlSetState(-1,$GUI_ACCEPTFILES) GUICtrlSetState(-1,$GUI_DISABLE) $LOG = GUICtrlCreateCheckbox ("/LOG :: Output status to LOG file (overwrite existing log)", 25, 400, 300, 20) While 1 $msg = GUIGetMsg() If GUIRead($LOG) = $GUI_CHECKED Then GUICtrlSetState ($LOGFILLOC, $GUI_ENABLE) Else EndIf EndIf Edited November 25, 2004 by SlimShady Link to comment Share on other sites More sharing options...
jpm Posted November 25, 2004 Share Posted November 25, 2004 Thanks, i have already done this, but still not working..Here is my code this far:expandcollapse popupGlobal $LOGFILLOC = GUICtrlCreateInput ("", 30, 195 , 300, 20) GUICtrlSetState(-1,$GUI_ACCEPTFILES)GUICtrlSetState(-1,$GUI_DISABLE)$LOG = GUICtrlCreateCheckbox ("/LOG :: Output status to LOG file (overwrite existing log)", 25, 400, 300, 20)While 1 $msg = GUIGetMsg() If GUIRead($LOG) = $GUI_CHECKED Then GUICtrlSetState ($LOGFILLOC, $GUI_ENABLED) Else EndIf EndIf[code=auto:0]When using this, I get an error saying I have not defined $LOGFILLOC as a variable. But I have declared this as a Global variable already, what am I doing wrong?CheersSee attachment[post="43275"]<{POST_SNAPBACK}>[/post]the error come from $GUI_ENABLED and not from $LOGFILLOCthe state variable is $GUI_ENABLE Link to comment Share on other sites More sharing options... lyledg Posted November 25, 2004 lyledg Active Members 287 Author Share Posted November 25, 2004 Mate So is the code I am using correct or not? I am a little confused by your answer.. Cheers Link to comment Share on other sites More sharing options... MHz Posted November 25, 2004 MHz MVPs 5.6k 30 Just simple Share Posted November 25, 2004 I am a little confused by your answer..As SlimShady has done. He has inserted at the top of his rewrite of your script.#include <GUIConstants.au3>You need to have this in Gui scripts. It contains this$GUI_ENABLEThis was causing problems. And as jpm described with$GUI_ENABLEDshould be$GUI_ENABLEHope this clears your thoughts on your code.My advise. lose the else and the extra endif. And add Wend to close the While loop#include <GUIConstants.au3> Global $LOGFILLOC = GUICtrlCreateInput ("", 30, 195 , 300, 20) GUICtrlSetState(-1,$GUI_ACCEPTFILES) GUICtrlSetState(-1,$GUI_DISABLE) $LOG = GUICtrlCreateCheckbox ("/LOG :: Output status to LOG file (overwrite existing log)", 25, 400, 300, 20) While 1 $msg = GUIGetMsg() If GUIRead($LOG) = $GUI_CHECKED Then GUICtrlSetState ($LOGFILLOC, $GUI_ENABLE) EndIf WendGood luck. Link to comment Share on other sites More sharing options... lyledg Posted November 25, 2004 Author Share Posted November 25, 2004 Thanks Guys!! I was too tired to see what JPM had actually meant... Thanks for the explanation! All working now.. Link to comment Share on other sites More sharing options... 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 More sharing options... Followers 0
lyledg Posted November 25, 2004 Author Share Posted November 25, 2004 Thanks Guys!! I was too tired to see what JPM had actually meant... Thanks for the explanation! All working now.. Link to comment Share on other sites More sharing options...
Recommended Posts
Recently Browsing 0 members