Sign in to follow this  
Followers 0
atomman

Possible bug: GUICtrlSetBkColor

8 posts in this topic

#1 ·  Posted (edited)

I'm very new to AutoIt and coding in general, so i didn't want to dump this in the bug box without confirming. See sig for versions.

Run it, then do one of the following:

- click down on the "drag" area, release, and the MsgBox appears

- click the button and you may get multiple instances of the MsgBox

- comment out GUICtrlSetBkColor and it works as it should

- change GUICtrlCreateButton to GUICtrlCreateLabel and it works fine

#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 120, 25, -1, -1)
$Button1 = GUICtrlCreateButton("Button1", 0, 0, 75, 25, 0)
; if comment out below, problem disappears
GUICtrlSetBkColor(-1, 0x20A107)
$Label1 = GUICtrlCreateLabel("drag", 88, 0, 25, 25, -1, $GUI_WS_EX_PARENTDRAG)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            MsgBox(0, "", "did i open without clicking button? or multiple times?")
    EndSwitch
WEnd
Edited by atomman

Share this post


Link to post
Share on other sites

I'm very new to AutoIt and coding in general, so i didn't want to dump this in the bug box without confirming. See sig for versions.

Run it, then do one of the following:

- click down on the "drag" area, release, and the MsgBox appears

- click the button and you may get multiple instances of the MsgBox

- comment out GUICtrlSetBkColor and it works as it should

- change GUICtrlCreateButton to GUICtrlCreateLabel and it works fine

#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 120, 25, -1, -1)
$Button1 = GUICtrlCreateButton("Button1", 0, 0, 75, 25, 0)
; if comment out below, problem disappears
GUICtrlSetBkColor(-1, 0x20A107)
$Label1 = GUICtrlCreateLabel("drag", 88, 0, 25, 25, -1, $GUI_WS_EX_PARENTDRAG)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            MsgBox(0, "", "did i open without clicking button? or multiple times?")
    EndSwitch
WEnd
Beta works fine, release is where I was able to duplicate the problem.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

No problem: 3.2.4.9

Share this post


Link to post
Share on other sites

Ah jeez! I am using 3.2.9.3. What i'm NOT using is my HEAD! I keep smacking F5 to run and wasn't using the beta compiler!

excuse me while i find a dark corner to hide in...

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Ah, wait a minute... don't have problem with the example posted anymore, but still problematic with my script in its entirety. Will try to isolate and get back.

Edited by atomman

Share this post


Link to post
Share on other sites

excuse me while i find a dark corner to hide in...

Been there, done that...lol

Actually, I think most of us have!

at least you know how to ask a question!!

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

With the whole script, it seems to be working fine now. Not sure what's going on, but i will be paying close attention to what version of AutoIt i'm using to run/compile from now on.

Case closed... i think :)

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