RadioButton TextColor

76 views
Skip to first unread message

Jean-Marie Berthiaume

unread,
May 31, 2004, 4:08:11 PM5/31/04
to

Can you confirm RadioButto:TextColor don't work in VO 2.7a

--
Jean-Marie Berthiaume
Montréal, Québec

Attention. Enlever le premier . pour me rejoindre
Please erase the first . to reply :
(jie...@videotron.ca)


Karl Faller

unread,
May 31, 2004, 5:21:13 PM5/31/04
to
Jean-Marie,

>>Can you confirm RadioButto:TextColor don't work in VO 2.7a

Sorry, works for me on XP SP1 latest patches.

Karl

Michael Rubinstein

unread,
May 31, 2004, 5:59:19 PM5/31/04
to
Jean-Marie, do you use XP themes? Under Windows2000 radio button text
color works fine. 2.7a fixed many GUI problems that required awkward tricks,
like processing WM_CTLCOLORSTATIC in application code. You may have code
'fixing' old problems that are not there anymore interfering with normal
painting. If it is not the case, try the usual tricks like reindexing the
project.

Michael

"Jean-Marie Berthiaume" <ji....@videotron.ca> wrote in message
news:40BB90AB...@videotron.ca...

Jean-Marie Berthiaume

unread,
May 31, 2004, 8:53:35 PM5/31/04
to
Michael

That's exactly what I'm doing : taking out old fixes because 2.7 is doing a real
good job in background painting windows and controls. But I'm in front of simple
DataWindow with a normal RadioButton on it and
CCRadioButton1:TextColor := Color{COLORYELLOW}.
But the color of the text is still Default.

Michael Rubinstein a écrit :

Michael Rubinstein

unread,
May 31, 2004, 11:46:11 PM5/31/04
to
Jean-Marie, I just made a test application - DataDialog with two Radio
Buttons. One with colored text, the other 'Auto'. The colored Radio Button
shows colored text. If you still have this problem, can you make a test
sample? I could take a look.

When taking out 'old fixes', be careful using ExStyle 'Transparent' for
Radio Buttons and Check Boxes. Don't use it for Group Boxes, unless they
have no caption. Style WS_EX_TRANSPARENT can be used without restrictions
for Fixed Text only. With Check Boxes and Radio Buttons you are safe until
you start changing captions at run time. Group Boxes will have border going
through the caption. This is not a VO limitation. If you use colored or
textured backgrounds, assign the same background to all controls that
inherit from TextControl, except for PushButton. If you have Fixed Icons,
the will need the same background as well. It can be done in a loop in the
window subclass Background() ASSIGN. If you do this way, you don't need
selecting ExStyle 'Transparent' in WED and your Group Boxes will look really
transparent - caption and border intact.

Cheers, Michael

"Jean-Marie Berthiaume" <ji....@videotron.ca> wrote in message

news:40BBD38F...@videotron.ca...

Karl Faller

unread,
Jun 1, 2004, 3:44:39 AM6/1/04
to
Jean-Marie,

>
>That's exactly what I'm doing : taking out old fixes because 2.7 is doing a real
>good job in background painting windows and controls. But I'm in front of simple
>DataWindow with a normal RadioButton on it and
>CCRadioButton1:TextColor := Color{COLORYELLOW}.
>But the color of the text is still Default.
Just tried with my production app - my prior test was on a dialog,
here now on a datawindow - simply works.
Karl

P.S: But while testing a long "friend" reappeared, Vo didn't find the
DBFPath of my customertable (read from a global) - a touch all fixed
it, but seems like i should recode that part finally ;-(

Jean-Marie Berthiaume

unread,
Jun 1, 2004, 5:40:34 PM6/1/04
to
Hi Karl and Michael

I have to take your word for it. Here I can't make it work. I'm on a fresh 2.7a
installation where I didn't change anything in the VO Classes. I just created a new
MDI app. Created a simple DataWindow with the WED. Put on a single PushButton. Just
change the TextColor in the WED menu and... nothing. Old black on grey.

BUT, while I was writing this, I took out the XP theme manifest RESOURCE and... yes
yellow caption. Is this the expected behaviour ?

Karl Faller a écrit :

--

Michael Rubinstein

unread,
Jun 1, 2004, 9:46:40 PM6/1/04
to
Jean-Marie, I guess we are still discussing Radio Buttons? There is
another report about Radio Button and Check Box captions loosing text color
on Data Windows with XP themes. I can't verify, my development machine is
(still) Windows2000. Can you check how same controls behave on a Dialog
Window with XP themes? There is no such thing as a 'Simple Data Window'.
Data Window is a GUI beast.

Michael

"Jean-Marie Berthiaume" <ji....@videotron.ca> wrote in message

news:40BCF7D2...@videotron.ca...

Karl Faller

unread,
Jun 2, 2004, 2:54:51 AM6/2/04
to
Jean-Marie,
>I have to take your word for it. Here I can't make it work. I'm on a fresh 2.7a
>installation where I didn't change anything in the VO Classes. I just created a new
>MDI app. Created a simple DataWindow with the WED. Put on a single PushButton. Just
>change the TextColor in the WED menu and... nothing. Old black on grey.
Did as you describe, (apart that Pushbutton has no Textcolor prop in
my WED ;-) - so i put a Radiobutton on it, selected Yellow, and voila.

>BUT, while I was writing this, I took out the XP theme manifest RESOURCE and... yes
>yellow caption. Is this the expected behaviour ?

It may be that it makes a difference, that i use the "classic" style
in my XP...

2min later: OK confirmed. I just changed to my wife's account (which
uses "XP Style", called VO, made MDI etc. - and nothing, no color.
Send it to bugshunter.

HTH
Karl

Sven Ebert

unread,
Jun 2, 2004, 6:31:10 AM6/2/04
to
Karl,

it is the XP visual styles standard behavior that CheckBox and
RadioButton text color property does not set the textcolor.
Messages like WM_CTLCOLORxxx are ignored.

The only way to overwrite this behaviour is to use custom- or ownerdrawing
technics.

Sven


Jean-Marie Berthiaume

unread,
Jun 2, 2004, 6:35:39 PM6/2/04
to
Sven,

So I will have to go back to "awkward tricks" as Michael call them. It'S so
beautiful to see a black RadioButton caption on a magnifique dark blue bitmap
background !?

Sven Ebert a écrit :

--

Jean-Marie Berthiaume

unread,
Jun 2, 2004, 7:22:50 PM6/2/04
to
>
> The only way to overwrite this behaviour is to use custom- or ownerdrawing
> technics.
>

What about oControl:DisableTheme() It's using the suppose normal XP behaviour
method of
SetWindowTheme(oControl:Handle(),"","") which as MSDN wrote it "Calling the
SetWindowTheme function with empty strings causes the control to render
without a visual style appearance."

But VO don't follow that rule.

Sven Ebert

unread,
Jun 4, 2004, 3:33:27 PM6/4/04
to
Jean-Marie,

> What about oControl:DisableTheme() It's using the suppose normal XP behaviour
> method of
> SetWindowTheme(oControl:Handle(),"","") which as MSDN wrote it "Calling the
> SetWindowTheme function with empty strings causes the control to render
> without a visual style appearance."
>
> But VO don't follow that rule.

Have you tested this?
Is the result like you would expect under all conditions?

If yes, please forward this information to Paul.
I am sure he would be very grateful about this.

Sven


Jean-Marie Berthiaume

unread,
Jun 7, 2004, 8:08:37 AM6/7/04
to
Sven,

What I mean was it looks impossible to disable the XP theme of the radiobutton. The
VO radiobutton don't respect the XP SetWindowTheme function which is suppose to
work with controls.

Sven Ebert a écrit :

--

Robert Pope

unread,
Jul 9, 2021, 1:58:36 PMJul 9
to
Replying for anyone else who stumbles across this thread (almost) 20 years later...

I got TextColor to work on a RadioButton by creating a subclass and calling SetWindowTheme(SELF:Handle(), "VO", "VO") in the Init() of the control. I don't know what the relevance of the strings are, but anything other than blank seems to work. I think I'm basically linking the control to a non-existent theme.

As suggested earlier in this thread, DisableTheme() didn't help nor did calling SetWindowTheme(SELF:Handle(), "", "").

If you are just seeing a white box after making that change, you've probably done what I did and have white text on a white background. I wasted an hour or so figuring that out. :(

Credit goes to this thread for making me think that it should work and keeping me chipping away at the problem until it worked: https://stackoverflow.com/questions/31854015/changing-win32s-radio-button-text-color
As it turned out, only the SetWindowTheme call was necessary.
Reply all
Reply to author
Forward
0 new messages