Sign in to follow this  
Followers 0
musahi0128

Unable to delete Updown with its input control

3 posts in this topic

#1 ·  Posted (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 by musahi0128

Share this post


Link to post
Share on other sites



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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Wow, thanks man, this is proof that i don't try to think it hard enough :v i can move on now ;)

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