Board index » cppbuilder » Button1->Font->Color?

Button1->Font->Color?

Ken,

You're right. It doesn't seem that you can change the font on TButton
even in the Object Inspector.
If you can use TBitBtn, it wouild be easy to use the same method to
change the font.

BitBtn1->Font->Color=clRed;

Hope this helps.

Regards,
Brett Miller

Quote
Ken Moffat wrote:
> How do I change the color of the font on a button.
> Button1->Font->Color = clRed or whatever doesn't work.

> Ken Moffat
> kmof...@halcyon.com

 

Re:Button1->Font->Color?


How do I change the color of the font on a button.
Button1->Font->Color = clRed or whatever doesn't work.

Ken Moffat
kmof...@halcyon.com

Re:Button1->Font->Color?


Wonder if that's a bug in BCB or Windows? Wonder about BCB3.
Oh, well.

On Thu, 12 Feb 1998 20:22:06 -0500, brett miller <b...@mxcapital.com>
wrote:

Quote
>Ken,

>You're right. It doesn't seem that you can change the font on TButton
>even in the Object Inspector.
>If you can use TBitBtn, it wouild be easy to use the same method to
>change the font.

>BitBtn1->Font->Color=clRed;

>Hope this helps.

>Regards,
>Brett Miller

>Ken Moffat wrote:

>> How do I change the color of the font on a button.
>> Button1->Font->Color = clRed or whatever doesn't work.

>> Ken Moffat
>> kmof...@halcyon.com

Ken Moffat
kmof...@halcyon.com

Re:Button1->Font->Color?


Quote
>>Wonder if that's a bug in BCB or Windows?

That could be debated.<g> It's not a bug at all, it's just the way the
standard button component works. The only way to change the color of the
button's text is by making the button owner-drawn. That's what TBitBtn does.
So, if you want colored text on your buttons then use a TBitBtn rather than
TButton.

--
Kent (TeamB and TurboPower Software)
-----------------------------------------------------
BCB Solutions Web Page - http://www.turbopower.com/bcb

Re:Button1->Font->Color?


Quote
Kent Reisdorph (TeamB) wrote:
> The only way to change the color of the button's text is by making the button
> owner-drawn.

What is ment by making the button owner-drawn?

Thanks,

Jacob Chist

Re:Button1->Font->Color?


Quote
Jacob Christ wrote:

> Kent Reisdorph (TeamB) wrote:

> > The only way to change the color of the button's text is by making the button
> > owner-drawn.

> What is ment by making the button owner-drawn?

The owner draws it :-)

You need to intercept the OnDraw event and change things yourself.
Actually, I think this is made very easy with a BltBtn.

Re:Button1->Font->Color?


Quote
>>What is ment by making the button owner-drawn?

When a button (or any other control) is owner-drawn it means that the
programmer takes responsibility for drawing the button. That means that you
have to draw the entire button: 3D border, face, text, etc. The VCL version
of an owner-drawn button is the TBitBtn.

--
Kent (TeamB and TurboPower Software)
-----------------------------------------------------
BCB Solutions Web Page - http://www.turbopower.com/bcb

Other Threads