Click here to Skip to main content
13,045,285 members (59,775 online)
Click here to Skip to main content
Add your own
alternative version


39 bookmarked
Posted 12 Jun 2001

Davide Calabro's CButtonST class port to WTL

, 26 Jun 2001
Rate this:
Please Sign up or sign in to vote.
A fully featured owner-draw button class






Now you can use Davide Calabro's excellent CButtonSt class in your ATL/WTL projects. The Class is still called CButtonSt and it retains a majority of the original code. Just follow these simple instructions:

  1. Create a WTL Project
  2. Design the dialog and add the button controls
  3. Add the ButtonST.h header file to your project
  4. Assign a CButtonSt to each button.
  5. In OnInitDialog,
    • Subclass each member controls (CButtonST) to each ID using the SubclassWindow method.
    • uses the CButtonSt methods to change the appearance of the control.
  6. In your dialog, don't forget to add the macro REFLECT_NOTIFICATIONS which allows the buttons to get messages like WM_DRAWITEM.
class MyDialog : public CDialogImpl<MyDialog>
  LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, 
    LPARAM /*lParam*/, BOOL& /*bHandled*/);
  CButtonST m_btn;

LRESULT MyDialog::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/,
  LPARAM /*lParam*/, BOOL& /*bHandled*/) 

See Davide Calabro's original CButtonSt article for more details.

Latest Updates

  • 26 June 2001
    • Updated to Davide Calabro's version 3.2
    • Added support for defining the icons from an image list
    • Added support for creating dynamically the buttons
  • 14 June 2001 - Fixed a bug in the autorepeat feature

Serge Thank you.


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.

A list of licenses authors might use can be found here


About the Author

Serge Weinstock
Web Developer
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralThank you ! Pin
flg61873024-Nov-09 0:51
memberflg61873024-Nov-09 0:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170713.1 | Last Updated 27 Jun 2001
Article Copyright 2001 by Serge Weinstock
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid