BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unable to change colour of TCheckBox label in existing proje

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Kris
Guest





PostPosted: Mon May 14, 2007 7:09 pm    Post subject: Unable to change colour of TCheckBox label in existing proje Reply with quote



Hi,

I've encountered a strange problem with changing the colour of a
TCheckBox Label (the actual text colour, not the background). Normally,
this isn't a problem. You can simply use the Font->Color property to
change the colour (either via the object inspector at design time or
change it at run-time).

When I add a checkbox to my current project and change the colour of the
checkbox label it does get shown in the correct colour while in design
mode. However, as soon as I run my app the text colour is the default
black again. Even setting the colour propery during run-time does not
resolve the issue (MyCheckBox->Font->Color=clGreen).

Strangely enough, when I start fresh with a new project and add a
TCheckBox I have no problems whatsoever with changing the text colour.
It's just with my current project that I'm having these strange
problems. I even commented out my constructor to completely exclude the
possibility that some of my startup-code was causing this strange
behaviour. But nothing helps...

If anyone has any ideas as to what is causing this strange problem, then
please let me know.

I'm using BDS2006 Update2.

Thanks,

Kris
Back to top
Pete Fraser
Guest





PostPosted: Mon May 14, 2007 7:18 pm    Post subject: Re: Unable to change colour of TCheckBox label in existing p Reply with quote



Could this be because you have XP Theming turned on?
This could over-write your settings. It certainly does for
some other controls.
You won't see this in the BDS2006 designer as it is not
themed.
(Delphi 2007 is themed (and presumably so will C++Builder
2007) and shows this.)

HTH Pete

"Kris" <test (AT) test (DOT) com> wrote in message
news:46486dbf$1 (AT) newsgroups (DOT) borland.com...
Quote:
Hi,

I've encountered a strange problem with changing the
colour of a TCheckBox Label (the actual text colour, not
the background). Normally, this isn't a problem. You can
simply use the Font->Color property to change the colour
(either via the object inspector at design time or change
it at run-time).

When I add a checkbox to my current project and change the
colour of the checkbox label it does get shown in the
correct colour while in design mode. However, as soon as I
run my app the text colour is the default black again.
Even setting the colour propery during run-time does not
resolve the issue (MyCheckBox->Font->Color=clGreen).

Strangely enough, when I start fresh with a new project
and add a TCheckBox I have no problems whatsoever with
changing the text colour. It's just with my current
project that I'm having these strange problems. I even
commented out my constructor to completely exclude the
possibility that some of my startup-code was causing this
strange behaviour. But nothing helps...

If anyone has any ideas as to what is causing this strange
problem, then please let me know.

I'm using BDS2006 Update2.

Thanks,

Kris
Back to top
Kris
Guest





PostPosted: Mon May 14, 2007 7:33 pm    Post subject: Re: Unable to change colour of TCheckBox label in existing p Reply with quote



Pete Fraser wrote:
Quote:
Could this be because you have XP Theming turned on?
This could over-write your settings. It certainly does for
some other controls.

You're absolutely correct. My current project does use XP theming which
is causing the 'problem'. At least now I know what is causing this.

I assume it won't be possible to change the colour (other than disabling
theming, which isn't an option).

Thanks,

Kris
Back to top
Pete Fraser
Guest





PostPosted: Mon May 14, 2007 7:48 pm    Post subject: Re: Unable to change colour of TCheckBox label in existing p Reply with quote

I believe there is a call to turn theming off for a control
but you need to be careful as if you make a checkbox font
red and then a user sets their theme so that red text is
unreadable - your application will be not nice to use.
you probably need to change your UI so that you don't need
to change font colors but use something else.
HTH Pete

"Kris" <test (AT) test (DOT) com> wrote in message
news:46487363$1 (AT) newsgroups (DOT) borland.com...
Quote:
Pete Fraser wrote:
Could this be because you have XP Theming turned on?
This could over-write your settings. It certainly does
for some other controls.

You're absolutely correct. My current project does use XP
theming which is causing the 'problem'. At least now I
know what is causing this.

I assume it won't be possible to change the colour (other
than disabling theming, which isn't an option).
Back to top
Kris
Guest





PostPosted: Tue May 15, 2007 3:55 pm    Post subject: Re: Unable to change colour of TCheckBox label in existing p Reply with quote

Pete Fraser wrote:
Quote:
you probably need to change your UI so that you don't need
to change font colors but use something else.

My application is a wizard style. The navigation bar at the bottom of
the wizard respects the Windows theme. However, the rest of the wizard
is a typical white pane with black text on which the wizard's
functionality is displayed. In order to make absolutely sure that the
checkboxes are correctly displayed on the white background I wanted make
sure they were always displayed in black.

Well, I don't expect to encounter much problems from not setting the
CheckBox text colour. I'm expecting more problems if I force theming off
for the CheckBoxes. So, I'll leave it like it is.

Thanks,

Kris
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.