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 

TButoon Text-color?

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





PostPosted: Thu May 19, 2005 7:59 am    Post subject: TButoon Text-color? Reply with 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!


Back to top
Antonio Felix
Guest





PostPosted: Thu May 19, 2005 10:21 am    Post subject: Re: TButoon Text-color? Reply with quote




"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





PostPosted: Thu May 19, 2005 10:52 am    Post subject: Re: TButoon Text-color? Reply with quote




"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





PostPosted: Thu May 19, 2005 10:52 am    Post subject: Re: TButoon Text-color? Reply with quote

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
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.