Aceguy Posted June 24, 2006 Posted June 24, 2006 please help #include <GUIConstants.au3> GUICreate("My GUI state") $combo=GUICtrlCreateCombo("",20,20,80,20) GUICtrlSetData(-1,"Enable|Disable") $my_button=GUICtrlCreateButton("????",20,60,50,20) GUISetState () While 1 $msg = GUIGetMsg() if GUICtrlRead($combo) = "Disable" Then GUICtrlSetState($my_button,$GUI_DISABLE) Else GUICtrlSetState($my_button,$GUI_ENABLE) EndIf Select case $msg =-3 ExitLoop EndSelect Wend it obviously flickers because its been constantly updated, but how can i make this script work in this way, cos i dont want another button to click to read the combobox.... many thanks [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Skruge Posted June 24, 2006 Posted June 24, 2006 Welcome to the forums! Changing the combobox registers a message, so you only need to check it when it changes.#include <GUIConstants.au3> GUICreate("My GUI state") $combo = GUICtrlCreateCombo("", 20, 20, 80, 20) GUICtrlSetData(-1, "Enable|Disable") $my_button = GUICtrlCreateButton("????", 20, 60, 50, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $combo If GUICtrlRead($combo) = "Disable" Then GUICtrlSetState($my_button, $GUI_DISABLE) Else GUICtrlSetState($my_button, $GUI_ENABLE) EndIf Case $msg = -3 ExitLoop EndSelect WEnd [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
PsaltyDS Posted June 25, 2006 Posted June 25, 2006 Welcome to the forums! Changing the combobox registers a message, so you only need to check it when it changes.#include <GUIConstants.au3> GUICreate("My GUI state") $combo = GUICtrlCreateCombo("", 20, 20, 80, 20) GUICtrlSetData(-1, "Enable|Disable") $my_button = GUICtrlCreateButton("????", 20, 60, 50, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $combo If GUICtrlRead($combo) = "Disable" Then GUICtrlSetState($my_button, $GUI_DISABLE) Else GUICtrlSetState($my_button, $GUI_ENABLE) EndIf Case $msg = -3 ExitLoop EndSelect WEnd Alternatively, the best way to stop GUI flickering is to use EVENT MODE and watch the control with GuiCtrlSetOnEvent. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Aceguy Posted June 25, 2006 Author Posted June 25, 2006 Thanks Soooooooo much again, YOU GUY ARE THE BEST>!!!!!!!! [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
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