Sign in to follow this  
Followers 0
Aceguy

Odd Flickering....... I know why, but cant srort it.

4 posts in this topic

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

Share this post


Link to post
Share on other sites



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]

Share this post


Link to post
Share on other sites

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.

:D


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

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  
Followers 0