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;
 btColorFondo.Repaint;

Thanks.
pin_plunderAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
intheConnect With a Mentor Commented:
Hi
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      http://sunsite.icm.edu.pl/delphi/
US mirror site:      http://www.cdrom.com/pub/delphi_www/ Torry's Delphi Pages    http://www.torry.ru/  


Regards Barry
0
All Courses

From novice to tech pro — start learning today.