Sample Image - sample.gif

With this class you can easily give a skin to your buttons in few steps:

  1. Add "xSkinButton.cpp" and "xSkinButton.h" to the project.
  2. Include "xSkinButton.h" in the header file where the controls are defined
  3. In the resource editor check the "Owner Draw" property for the buttons that you want to customize
  4. Create (or edit) a member variable for each button you want to customize as CxSkinButton. If the Class Wizard doesn't show the CxSkinButton type, select CButton and then edit the code manually.
  5. Add the bitmap resource for the buttons:
  6. In the window initialization add the CxSkinButton methods:
    BOOL CxSkinButtonDemoDlg::OnInitDialog()
    {
    //	...
    	m_btn1.SetTextColor(RGB(255,0,0));
    	m_btn1.SetToolTipText("Button1");
    	m_btn1.SetSkin(IDB_B1NORM,IDB_B1DOWN,IDB_B1OVER,IDB_B1GRAY,IDB_B1MASK,0,0,0);
    //	...
    

    The SetTextColor and SetToolTipText are self explaining; SetSkin is:
    void CxSkinButton::SetSkin(UINT normal,UINT down,UINT over,UINT disabled,UINT mask, short drawmode, short border, short margin)

Remarks

Release History

v1.00 - 15/03/2001

basic implementation and interface.

v1.10 - 28/03/2001

 enhanced mouse tracking implementation (by Milan Gardian).

v1.20 - 02/04/2001

v1.21 - 14/04/2001

Compatibility

Win95,WinNT = Yes, requires IE3.0 or higher
Win98, WinME, W2k, Whistler = Yes

For any questions, e-mail to: ing.davide.pizzolato@libero.it

Thanks to all the Code Project developers!
Special thanks to:
Milan Gardian for mouse and keyboard tracking code.
Andy Green and Cameron Epp for suggestions & debugging.