musahi0128 Posted October 25, 2014 Share Posted October 25, 2014 (edited) Hello forum, I have a checkbox in main.au3 : $Checkbox14 = GUICtrlCreateCheckbox("Item in First Backpack slot qty", 10, 266) GUICtrlSetOnEvent($Checkbox14, "_Checkbox14") I create a function which is called upon change in checkbox in separate functions.au3 script : Func _Checkbox14() $i = GUICtrlRead($Checkbox14) If $i = 1 Then $Input1 = GUICtrlCreateInput("", 192, 266, 53, 21, 0x1) GUICtrlSetLimit($Input1, 2) $updown1 = GUICtrlCreateUpdown($Input1) GUICtrlSetLimit($Updown1, 99) Else GUICtrlDelete(-1) EndIF EndFunc What i want to achive is that when the checkbox is unchecked, the Input and Updown are deleted, but only the Updown get deleted. I tried to use GUICtrlDelete(-1) twice, which has same result. I also tried to delete it with code below which is give "variable used without being declared" : GUICtrlDelete($Input1) GUICtrlDelete($Updown) And when i set the variable with code below, i get nothing done : Local $Input1, $Updown1 Can anyone help me on this one Complete scripts attached. And oh, sorry for my bad English. :v hmholv.zip Edited October 25, 2014 by musahi0128 Link to comment Share on other sites More sharing options...
Developers Solution Jos Posted October 25, 2014 Developers Solution Share Posted October 25, 2014 Try: ; put this at the top somewhere Global $updown1,$Input1 Func _Checkbox14() $i = GUICtrlRead($Checkbox14) If $i = 1 Then $Input1 = GUICtrlCreateInput("", 192, 266, 53, 21, 0x1) GUICtrlSetLimit($Input1, 2) $updown1 = GUICtrlCreateUpdown($Input1) GUICtrlSetLimit($Updown1, 99) Else GUICtrlDelete($updown1) EndIF EndFunc SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
musahi0128 Posted October 27, 2014 Author Share Posted October 27, 2014 Wow, thanks man, this is proof that i don't try to think it hard enough :v i can move on now 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