Jump to content

Recommended Posts

Posted

#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?

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...