Abstract

These are days where almost everything can be skinned or customized.
If you have taken a look at the new Windows XP you will have noticed that even buttons can
have a look far away from that we know.

Even if I don't like very much hard customizations I've noticed how much people liked a button control
called CxShadeButton posted by Davide Pizzolato.
The idea I've got is to make available one or two virtual functions from CButtonST, the reference
control for MFC flat buttons, to let the developer to derive his own class and implement custom background paint
still having all the features from the CButtonST control.
To show this new feature I've decided to reproduce the look and feel of CxShadeButton. I've extracted from
the original code the class called CxDib and the code that creates and draws the background effects.

The developer derives his own class from CButtonST then implements these two functions in his new class.

Example

The CButtonST demo application includes a page that shows how to implement new effects. A class
called CShadeButtonST has been derived from CButtonST and the new effects has been implemented
mainly in the OnDrawBackground method.

Remarks

This architecture makes possible to produce a whole range of buttons not available by default. If someone implements
the look and feel of the new buttons found in Windows XP I will happy to include his code in the next
CButtonST demo application.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.