Jump to content

Windows XP style appearance and GUICtrlSetColor


Yves1Fix
 Share

Recommended Posts

GUICtrlSetColor don't work on some controls if I use Windows XP style appearance.

In the following example, group and checkbox are not red.

I don't have this problem with Windows Classic style appearance.

Any help ?

Thanks

YvesOneFix

CODE

#include <GUIConstants.au3>

GUICreate("Test color - Windows XP style appearance")

GUICtrlCreateLabel("label (red)", 10, 20)

GUICtrlSetColor(-1, 0xff0000) ; Red

GUICtrlCreateGroup("group (not red?)", 10, 40, 150, 50)

GUICtrlSetColor(-1, 0xff0000) ; Red

GUICtrlCreateCheckbox("checkbox (not red?)", 15, 60, 140)

GUICtrlSetColor(-1, 0xff0000) ; Red

GUISetState ()

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

Link to comment
Share on other sites

Hey YvesOneFix,

I tested out your example code, tried applying various Label/Static Styles (at times these things interact a bit strange.. just to to check).. finally tried under various themes. Final verdict: seems a no go :/

Also states in the manual that: "Checkbox or Progress controls cannot be painted if the Windows XP style is used." so conclusion must be that this includes Group too.

Guess you'll have to go manual-hack in case you need a weirdly colored AND themed Windows experience :)

Sunaj

GUICtrlSetColor don't work on some controls if I use Windows XP style appearance.

In the following example, group and checkbox are not red.

I don't have this problem with Windows Classic style appearance.

Any help ?

Thanks

YvesOneFix

Link to comment
Share on other sites

Cheats way to set the colour of text for the Checkbox and mimic Group ctrl to set text colour...

#include <GUIConstants.au3>

GUICreate("Test color - Windows XP style appearance")

GUICtrlCreateLabel("checkbox (is red?)" , 32, 63, 110,20, $SS_SIMPLE)
GUICtrlSetColor(-1, 0xff0000) ; Red
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateCheckbox("", 15, 60, 110, 20, $WS_CLIPSIBLINGS)


GUICtrlCreateLabel("Group text", 15, 35, 55, 15, $SS_CENTER)
GUICtrlSetColor(-1, 0xff0000) ; Red
GUICtrlCreateButton("",  5, 40, 150, 50, $WS_CLIPSIBLINGS)
GUICtrlSetColor(-1, 0); dummy the button txt color
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState ()

While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Cheers

Edited by smashly
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...