Sign in to follow this  
Followers 0
covaks

How to get Button to only run once?

3 posts in this topic

#include <GUIConstants.au3>

GUICreate("test")

$Button = GUICtrlCreateButton ("test",5,5)
GUICtrlSetBkColor(-1,0xFF0000)
                
GUISetState (@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
    If $msg = $Button Then
        msgbox(1,"","I should only pop up once")
    EndIf
Wend

If I run the above and click on the button, the msgbox pops up twice. If I comment out the GUICtrlSetBkColor(-1,0xFF0000) line, then re-run and click on the button, msgbox pops up once, which is what I want.

Is that supposed to be like that? Or am I missing something? Why does coloring the button cause the msg to be received twice? I'm using v3.2.8.1

I know how to get around it, I'm just wondering if this is a bug, or if I'm supposed to color my buttons another way?

Share this post


Link to post
Share on other sites



nm. I'd delete this If I knew how. I just upgraded to 3.2.10.0 and it's fixed.

Share this post


Link to post
Share on other sites

It's a known bug in 3.2.8.1, you should be okay now.

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