Science, Tech, Math Computer Science TColorButton With Color Properties Make Your Own Button Component With Custom Colors Share Flipboard Email Print Topic Images, Inc./Topic Images/Getty Images Computer Science Delphi Programming Tutorials Basics Database Applications Advanced Delphi PHP Programming Language Perl Programming Language Python Programming Java Programming JavaScript Programming C & C++ Programming Ruby Programming Visual Basic View More by Zarko Gajic Zarko Gajic is experienced in SQL and has working knowledge of DB systems such as MS SQL Server, Firebird, Interbase, and Oracle. He is also proficient in XML, DHTML, and JavaScript. Updated October 16, 2017 The background color of a TButton is controlled by Windows, not Delphi. TButton is a simple wrapper around the standard Windows button, and Windows does not allow it to be colored except by choosing the colors in Control Panel. This means you can not set the background color of a TButton, nor you can change the background color of TBitBtn or TSpeedButton. Since Windows insists on doing the background coloring with clBtnFace, the only way to change it is to draw the button yourself by making an owner-drawn button component. TColorButton Source Code The TColorButton adds three new properties to the standard TButton: BackColor - Specifies the background color of the buttonForeColor - Specifies the color of the button text. Note that this "overrides" the Font.Color propertyHoverColor - Specifies the color used to paint the button's background when the mouse hovers over the button. Here's how to set color-related properties of the TColorButton at runtime: ColorButton1.BackColor := clOlive; //background ColorButton1.ForeColor := clYelow; //text ColorButton1.HoverColor := clNavy; //mouse over Installing Into a Component Palette The TColorButton comes as a single unit file with the .PAS file extension. After downloading the component, you need to install the source component into an existing package. Continue Reading