A standard TButton is just a wrapper for the Windows pushbutton
control, it is completely drawn by Windows, not by VCL code.
The Windows button control has support for "owner-drawing", which is
actually used by TBitBtn internally. To enable this feature the button
has to use the BS_OWNERDRAW window style. Windows then sends
WM_MEASUREITEM and WM_DRAWITEM messages to the button's parent window.
The VCl containers are designed to send these messages back to the
button as CN_MEASUREITEM and CN_DRAWITEM, respectively. These are the
messages you would have to handle in a custom button, and you would do
all drawing inside the handler for the CN_DRAWITEM message.
If you have a Delphi version that includes the source code, look at
buttons.pas, find the source for TBitBtn.CreateParams (that is where
you set the button style) and TBitBtn.CNMeasureItem and
TbitBtn.CNDrawItem, that is where the two messages are handled.
--
Peter Below