Link to home
Start Free TrialLog in
Avatar of ralph78
ralph78Flag for France

asked on

colored button

Hi all!
i want to use a colored button in my app. (the button' style is the same that a TButton, but i want to be able to choose the foreground color (and i want to keep the caption too!))

thanks, ralph
Avatar of MarcG
MarcG

I don't think it is possible to change the color of a button this easy ... since a button color can be chosen system wide in display properties.
And a button also doesn't have a canvas so you cannot paint yourself on it.
maybe here is something for you...
http://www.torry.net/gradientbuttons.htm
ASKER CERTIFIED SOLUTION
Avatar of MarcG
MarcG

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can create your own button class, publish color property and create custom Paint method. Look in sources:
[$DELPHIDIR]\Source\Vcl\buttons.pas
Hi
here is a snip from the description of a color button comp.
I can't recall where I got this... but if you would like me to mail it to you ... leave me an e address and I'll send it to you... it's a good comp and will do everything you want and more:)
T.
***************************

COLORBUTTON COMPONENT VERSION 1.8

COPYRIGHT 1996 JONATHAN GRANT OF INFORMATION EXPRESSIONS

About
This is an enhancement of the standard component issued with Delphi32. Unlike the Delphi component however, this enhanced version gives you much more control over how the button looks on screen.
This release fixes a problem with the redrawing of disabled buttons makes the button respond to messages from the keyboard and accept the focus, as well as supporting accelerator keys too.
Avatar of ralph78

ASKER

ok tongalite, u can send me this component at ralph78@club-internet.fr
Avatar of ralph78

ASKER

thanks all!