Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

A WTL XP Button and Edit Box

0.00/5 (No votes)
12 Sep 2002 1  
A WTL Implementation of XP Button and Edit Box

Sample Image

Introduction

This is a WTL implementation of XP Button and Edit Box Controls. The XP Button is actually a WTL port of an XP button. The Edit Box is painted in XP style by handling the WM_NCPAINT message. It is a very simple task.

How to use it

To add the XP Button and Edit box in your control, add a reference to CXPButton and CEditXP to you Dialog class.

\CXPButton m_ok;
CEditXP m_edit;

Add the following reflection macro to your main message map:

  BEGIN_MSG_MAP(CMainDlg)
     ...
     REFLECT_NOTIFICATIONS()
  END_MSG_MAP()
And then in the OnInitDialog function add,
m_ok.SubclassWindow(GetDlgItem(IDOK));
m_edit.SubclassWindow(GetDlgItem(IDC_EDIT1));
Don't forget to add #include "ButtonXP.h" to your Dialog's header file. Now compile the code and enjoy it.

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.

A list of licenses authors might use can be found here