Fran Posted September 6, 2010 Share 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 Link to comment Share on other sites More sharing options...
wakillon Posted September 6, 2010 Share 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.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted September 6, 2010 Share 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 Link to comment Share on other sites More sharing options...
Fran Posted September 6, 2010 Author Share Posted September 6, 2010 I added the variable, but it still flickers Link to comment Share on other sites More sharing options...
wakillon Posted September 6, 2010 Share Posted September 6, 2010 I added the variable, but it still flickers Dim $_var=1 must be outside your loop ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Fran Posted September 6, 2010 Author Share 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! Link to comment Share on other sites More sharing options...
wakillon Posted September 6, 2010 Share 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.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Fran Posted September 7, 2010 Author Share Posted September 7, 2010 100% Thanx dude! 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