Jump to content
Sign in to follow this  
lilx

Refreshing GUI

Recommended Posts

lilx

hello,

i am currently working a new program for my self. and i have a combo box disabled from the beginning and i want to enable it when a checkbox is pressed how i manage to enable the combo box without closing my gui at that moment.

thanks in advance,

lilx

Share this post


Link to post
Share on other sites
lilx

here is my code,

#include <GUIConstants.au3>


$Form1_1 = GUICreate("Form1", 397, 345, 283, 131)
$RoseBuff = GUICtrlCreateTab(8, 8, 377, 297)
$TabSheet1 = GUICtrlCreateTabItem("Config")
$Group1 = GUICtrlCreateGroup("Cooldown Time", 216, 40, 161, 65)                                             
$Combo1 = GUICtrlCreateCombo("", 224, 72, 145, 25)                                                                          ; combobox for cooldown time
GUICtrlSetData($Combo1,"5.0 Second|4.5 Second|4.0 Second|3.5 Second|3.0 Second|2.5 Second|2.0 Second|1.5 Second","3.5 Second") ; combobox for cooldown time
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Control", 24, 40, 185, 137)
$Checkbox1 = GUICtrlCreateCheckbox("Enable menu 1", 40, 64, 137, 17)                                                        ; enable tabmenu1
$Checkbox2 = GUICtrlCreateCheckbox("Enable menu 2", 40, 88, 145, 17)                                                        ; enable tabmenu2
$Checkbox3 = GUICtrlCreateCheckbox("Enable menu 3", 40, 112, 137, 17)                                                       ; enable tabmenu3
$Checkbox4 = GUICtrlCreateCheckbox("Enable menu 4", 40, 136, 153, 17)                                                       ; enable tabmenu4
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pic1 = GUICtrlCreatePic("", 16, 184, 364, 116, BitOR($SS_NOTIFY,$WS_GROUP))
$Group3 = GUICtrlCreateGroup("Advance", 216, 112, 161, 65)
$Checkbox37 = GUICtrlCreateCheckbox("Loop Actions", 224, 128, 89, 17)                                                       ; loop actions
$Combo2 = GUICtrlCreateCombo("", 224, 152, 145, 25)
GUICtrlSetData($Combo2,"5 Times|10 Times|15 Times|30 Times|50 Times|100 Times|Infinite","Infinite")                         ; combobox loop times
GUICtrlSetState ( $Combo2, $GUI_DISABLE )
GUISetState(@SW_SHOW)

While 1
    $Gui = GUIGetMsg()
    Select
        Case $Gui = $GUI_EVENT_CLOSE
            Exit
        Case $Gui = $Checkbox37
;       Case $Gui =
;       Case $Gui =
    EndSelect
WEnd

and what i want is that when $checkbox37 (loop actions) is checked it enables $combo2

Hope you can give me a answer :)

Share this post


Link to post
Share on other sites
ValeryVal

These are new lines for your script after

Case $Gui = $Checkbox37

Case $Gui = $Checkbox37
            $State = GUICtrlRead($Checkbox37)
            if $State = 1 then 
                GUICtrlSetState ( $Combo2, $GUI_ENABLE )
            else
                GUICtrlSetState ( $Combo2, $GUI_DISABLE )
            endif

The point of world view

Share this post


Link to post
Share on other sites
lilx

thank you guys i was tryin to find a selution for a while but know i got it working thx :)

Edited by lilx

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.