65.9K
CodeProject is changing. Read more.
Home

A WTL XP Button and Edit Box

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.50/5 (2 votes)

Sep 13, 2002

viewsIcon

95380

downloadIcon

1528

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.