Fran Posted September 6, 2010 Posted September 6, 2010 I have a gui with this piece of code just before the "WEnd". $ReadTHEME = GUICtrlRead($themeINPUT) $ReadSAMPLES = GUICtrlRead($samplesINPUT) If Not ($ReadTHEME = "" Or $ReadTHEME = "Theme Name" And $ReadSAMPLES = "" Or $ReadSAMPLES = "10001234,10001235,10001236") Then GUICtrlSetState($butDONEexe, $GUI_ENABLE) EndIf It works great because the button is disabled while the input has not been changed. But the moment the user makes changes to both of the input boxes, $butDONEexe starts flickering and doesn't stop. How can I only enable it once it doesn't keep looping and enabling the whole time? F
wakillon Posted September 6, 2010 Posted September 6, 2010 Add a variable when first action ! Dim $_var=1 $ReadTHEME = GUICtrlRead($themeINPUT) $ReadSAMPLES = GUICtrlRead($samplesINPUT) If $_var Then If Not ($ReadTHEME = "" Or $ReadTHEME = "Theme Name" And $ReadSAMPLES = "" Or $ReadSAMPLES = "10001234,10001235,10001236") Then GUICtrlSetState($butDONEexe, $GUI_ENABLE) $_var =0 EndIf EndIf AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
AdmiralAlkex Posted September 6, 2010 Posted September 6, 2010 Or you could use GUICtrlGetState() to see if the state needs changing. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Fran Posted September 6, 2010 Author Posted September 6, 2010 I added the variable, but it still flickers
wakillon Posted September 6, 2010 Posted September 6, 2010 I added the variable, but it still flickers Dim $_var=1 must be outside your loop ! AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
Fran Posted September 6, 2010 Author Posted September 6, 2010 Dim $_var=1 must be outside your loop !Well, now I feel like an idiot! Time to go home... no amount of coffee can rescue this day!
wakillon Posted September 6, 2010 Posted September 6, 2010 Well, now I feel like an idiot! Time to go home... no amount of coffee can rescue this day!So it works ? AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
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