Board index » cppbuilder » TButton->Font->Color

TButton->Font->Color

   I'm using bcb pro 5 and am trying, unsuccessfully, to change
the font color on a TButton.  I first used the Object Inspector
to set the Font Color to clGreen (and various other colors), but
the appearance of the button's font remains black.  I also tried
to change it programmatically, with the line
"Button1->Font->Color = clGreen;" -- to no effect.
   I can change the font color via my OS (Win98) display
properties
(Appearance->3D Objects->Font->Color), which seems to override
my program's TButton Font Color setting.
   Is there something that I can do to override the OS setting?
Thanks,
Bob

giesen-at-newmail-dot-net

 

Re:TButton->Font->Color


Quote
Bob wrote:
>    Is there something that I can do to override the OS setting?

How about using TBitBtn instead?

Re:TButton->Font->Color


Quote
"Bob" <nos...@please.net> wrote in message

news:3E205C25.DDA46384@please.net...

Quote
>    I'm using bcb pro 5 and am trying, unsuccessfully, to
> change the font color on a TButton.

The Font property has no meaning for TButton, as it gets all of its settings
from the OS directly.  The only reason Font appears for TButton to begin
with is because it is inherited from TControl.

Quote
>    I can change the font color via my OS (Win98) display
> properties (Appearance->3D Objects->Font->Color),
> which seems to override my program's TButton Font Color setting.

Correct, as well as the whole system in general.

Quote
>    Is there something that I can do to override the OS setting?

Not for TButton, , uless you change the button's style programmably via
SetWindowLong() to include the BS_OWNERDRAW style and then draw the button
yourself manually.  An easier way to go would be to use TBitBtn instead of
TButton.  TBitBtn is lready an owner-drawn button and allows the text color
to be changed via the Font property.

Gambit

Re:TButton->Font->Color


Quote
Fishface wrote:

> Bob wrote:

> >    Is there something that I can do to override the OS setting?

> How about using TBitBtn instead?

   Worked like a charm.  Thanks!

Re:TButton->Font->Color


Quote
"Remy Lebeau (TeamB)" wrote:

> "Bob" <nos...@please.net> wrote in message
> news:3E205C25.DDA46384@please.net...
> >    I'm using bcb pro 5 and am trying, unsuccessfully, to
> > change the font color on a TButton.

> The Font property has no meaning for TButton, as it gets all of its settings
> from the OS directly.  The only reason Font appears for TButton to begin
> with is because it is inherited from TControl.

> >    I can change the font color via my OS (Win98) display
> > properties (Appearance->3D Objects->Font->Color),
> > which seems to override my program's TButton Font Color setting.

> Correct, as well as the whole system in general.

> >    Is there something that I can do to override the OS setting?

> Not for TButton, , uless you change the button's style programmably via
> SetWindowLong() to include the BS_OWNERDRAW style and then draw the button
> yourself manually.  An easier way to go would be to use TBitBtn instead of
> TButton.  TBitBtn is lready an owner-drawn button and allows the text color
> to be changed via the Font property.

> Gambit

   Based on your and Fishface's advice, I used the TBitBtn,
instead.  Thanks for the extra information; it gives me
something more to play with, later.

Bob

Other Threads