Jump to content

Button flicker


Recommended Posts

Yes, I know this has been posted before. This is what I have. So, when checkbox $1 is checked, $OK is enabled, when it is enabled it flickers when you move your mouse, but not when it is disabled (which is where GUICtrlSetState($OK, $GUI_DISABLE) came into play). So, how could I make it so when $OK is activated, the button does not flicker?

$OK = GUICtrlCreateButton("Ok!", 252, 308, 40, 24)
GUICtrlSetState($OK, $GUI_DISABLE)


bla bla bla

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $msg = $build
            If BitAND(GUICtrlRead($1),$GUI_CHECKED) Then
                GUICtrlSetState($OK, $GUI_ENABLE)
            EndIf
        Case -3
            Exit
    EndSwitch
WEnd
Link to comment
Share on other sites

Ah, thank you, perfect. :mellow:

Case $msg = $OK
            If BitAND(GUICtrlRead($1),$GUI_UNCHECKED) Then

            If BitAND(GUICtrlGetState($OK), $GUI_DISABLE) <> $GUI_DISABLE Then GUICtrlSetState($OK, $GUI_DISABLE)
                
            Else

            If BitAND(GUICtrlGetState($OK), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($OK, $GUI_ENABLE)
                
            EndIf
Edited by thexshadow
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...