Jump to content

Change Group Background Color


Recommended Posts

I try to change the background color of a "group" inside a GUI window :

(using v3.1.1.123)

#include <GuiConstants.au3>
$myGUI = GuiCreate("Group Color test ",550,550,130,0)
$Group1 = GUICtrlCreateGroup("colored group", 14, 20, 520, 440)
GUICtrlSetBkColor(-1,0x00ff00); Green
GuiSetState()

While 1
    $msg = GuiGetMsg()
    Sleep ( 1 )
    Select
       Case $msg = $GUI_EVENT_CLOSE
           Exit
    EndSelect
WEnd

This only changes the text color , but not the whole background color as I expected ...

When using "koda" (the Gui builder tool in Scite), I see that the whole background is colored

in "koda", but once the code is executed in "autoit", only the text part is colored ... :)

#include <GUIConstants.au3>
; == GUI generated with Koda ==
$Form1 = GUICreate("AForm1", 622, 447, 192, 125)
$Group1 = GUICtrlCreateGroup("AGroup1", 88, 40, 409, 281)
GUICtrlSetBkColor(-1, 0x00ff00)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;;;;;
    EndSelect
WEnd
Exit

Is this intended ? is there a bug ?

How to color the whole background of a "group" ?

D2charkeeper = No more 'expired characters' in D2.File Date Changer = Change the file date(s), attributes and the filename case of multiple files @ once.Updater_full = Copy/Update your autoitscripts, pictures, .mp3, .avi etc ... subdirs from your PC to your memory stick or to your external harddisk. Now with scheduling and logging.Questmapper
Link to comment
Share on other sites

Here is a feeble attempt at a workaround

#include <GUIConstants.au3>
; == GUI generated with Koda ==);
$Form1 = GUICreate("AForm1", 622, 448, 192, 125)
$Group1 = GUICtrlCreateGroup("Group1", 112, 48, 281, 233)
$Graphic1 = GUICtrlCreateGraphic(112, 56, 281, 225)
GUICtrlSetColor(-1, 0xD4D0C8)
GUICtrlSetBkColor(-1, 0xA6CAF0)
GUICtrlSetState(-1, $GUI_DISABLE)
$Radio1 = GUICtrlCreateRadio("ARadio1", 152, 104, 113, 17)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$Radio2 = GUICtrlCreateRadio("ARadio2", 152, 136, 113, 17)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$Radio3 = GUICtrlCreateRadio("ARadio3", 152, 168, 113, 17)
GUICtrlSetBkColor(-1, 0xA6CAF0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;;;;;
    EndSelect
WEnd


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Thanks BigDod !

This is a good workaround.

Very helpfull :)

D2charkeeper = No more 'expired characters' in D2.File Date Changer = Change the file date(s), attributes and the filename case of multiple files @ once.Updater_full = Copy/Update your autoitscripts, pictures, .mp3, .avi etc ... subdirs from your PC to your memory stick or to your external harddisk. Now with scheduling and logging.Questmapper
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...