How to change color of buttons?

Is there an easy way of changing color of buttons? That
is buttons, bitbutton or speed buttons.
I'm using Delphi 5
cj
LVL 1
czechmateAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Stuart_JohnsonCommented:
Good question.  I know it can be done in VB...  But then,  you didn't ask that ;)
0
Slick812Commented:
hello czechmate, TSpeedButton does not have a "Color" property, nor does TBitBtn. You want an easy way, well here's an easy way with a speedbutton place on your form a TShape, the size of the button and have it be a rectangle with a Yellow color. Then place a SpeedButton in the same location as the TShape (on Top of it) and make it the same size as the TShape. Then set the Speedbutton property of "Flat" to True, and set "Transparent" to True. This will give you a flat style button with color. To color a non-Flat button needs some coding to get the Paint event of the speed button.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mohammed NasmanSoftware DeveloperCommented:
Hello

 there are some buttons with color property, you can download them with the source code from
 http://www.torry.net/buttons.htm

Best regards
Mohammed Nasman
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

jswebyCommented:
The way I have done this in the past is to put a TSpeedButton on a panel that is sized to the same size as the button. Set the Color property of the Panel to what you need and set the Transparent property of the TSpeedButton to True. Not elegant, but effective.

J.
0
robert_marquardtCommented:
TButton is an encapsulation of normal Windows buttons.
The button painting is handled by Windows.
The color is determined by the systemwide color settings.

As already mentioned you should download freeware button components from the usual locations.
0
czechmateAuthor Commented:
Thanks guys, and the points go to Slick812 who was the first to come up with the TShape solution. Does justice to your nickname:))
Thanks
cj
0
Slick812Commented:
you can also use a rectangle bitmap shape Glyph in a Bit Button, but you have to draw the Text for a caption on the Bitmap
0
czechmateAuthor Commented:
Yeah, that part I know and that's ok if you have a couple
of buttons. I am writing small calculator for fun and it
would be no fun to create 15 glyphs. What's more I battle
to draw straight lines not to mention pictures:)

I've stuffed around with shapes and it does not
look bad at all.

Thanks again and regards
cj
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.