Jump to content

Recommended Posts

Posted

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

Posted

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.0WIN 11 24H2 X64 - Other Examples Scripts

Posted

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!

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
×
×
  • Create New...