change button's background color

Well, the title says it all.
I'm using this code, but it doesn't seem to work.

 btColorFondo.Brush.Style := bsSolid;
 btColorFondo.Brush.Color := clRed;

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

intheConnect With a Mentor Commented:
you cannot do this with TButton etc, since the windows pushbutton control always paints itself with the button color defined in control panel. But you can use an owner-drawn button and take over painting yourself.
In fact there should be dozens of "TColorButton" etc. around already, search the usual Delphi sites.

Delphi Super Page
US mirror site: Torry's Delphi Pages  

Regards Barry
All Courses

From novice to tech pro — start learning today.