 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ron Eggler @ work Guest
|
Posted: Thu May 19, 2005 7:59 am Post subject: TButoon Text-color? |
|
|
Hi,
I'm trying to change the text-color of a button this way:
Main_Frm->Read_Btn->Font->Color = clRed;
but it doesn't do anything, no color-change, why?
Thanks!
|
|
| Back to top |
|
 |
Antonio Felix Guest
|
Posted: Thu May 19, 2005 10:21 am Post subject: Re: TButoon Text-color? |
|
|
"Ron Eggler @ work" <nospam (AT) hotmail (DOT) com> wrote:
| Quote: | Hi,
I'm trying to change the text-color of a button this way:
Main_Frm->Read_Btn->Font->Color = clRed;
but it doesn't do anything, no color-change, why?
Thanks!
|
Hi Ron,
Take a look at
http://www.swissdelphicenter.ch/torry/printcode.php?id=1100
HTH
Antonio
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu May 19, 2005 10:52 am Post subject: Re: TButoon Text-color? |
|
|
"Ron Eggler @ work" <nospam (AT) hotmail (DOT) com> wrote
| Quote: | I'm trying to change the text-color of a button this way:
Main_Frm->Read_Btn->Font->Color = clRed;
but it doesn't do anything, no color-change, why?
|
Because it is not supposed to. TButton does not support custom coloring at
all. It gets its coloring from the OS itself by using the settings that are
configured in the Control Panel. The only reason the Font property exists
in TButton is because it is published by TControl. If you want a
colorizable button, then you need to give TButton the BS_OWNERDRAW style and
then subclass it to handle the WM_DRAWITEM message. Or else use TBitBtn or
TSpeedButton instead, which are already owner-drawn buttons. Or find a
third-party colorizable button.
Gambit
|
|
| Back to top |
|
 |
Nikoali.Mikuszeit@uam.es Guest
|
Posted: Thu May 19, 2005 10:52 am Post subject: Re: TButoon Text-color? |
|
|
Hi,
had the same problem,in case of a TButon, it is not possible as the colour
is handled by Windows.
This question appears frequently and the solution is a self-made button
with a TPanel or a TBitBtn. You may find several hints in older threads or
in Google.
Regards Nikolai
|
|
| Back to top |
|
 |
|
|
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
|
|