Click here to Skip to main content
15,881,600 members
Articles / Desktop Programming / WTL
Article

A WTL XP Button and Edit Box

Rate me:
Please Sign up or sign in to vote.
2.50/5 (2 votes)
12 Sep 2002 94.1K   1.5K   24   14
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


Written By
Exciton Technologies LLP
India India
https://exciton.net

Comments and Discussions

 
GeneralLike it Pin
sadman from RM ))28-Apr-07 13:48
sadman from RM ))28-Apr-07 13:48 
GeneralCEditXP repainting problems FIXED (+) Pin
Ilya Semenov18-Apr-05 3:07
Ilya Semenov18-Apr-05 3:07 
QuestionIs there a CXPCombobox? Pin
eibimalul8-Nov-03 23:28
eibimalul8-Nov-03 23:28 
GeneralAbout using DDX Pin
Anonymous3-Jul-03 20:42
Anonymous3-Jul-03 20:42 
GeneralBugs Pin
varosi22-Apr-03 10:14
varosi22-Apr-03 10:14 
Generaltitlebar? (request) Pin
anon12317-Feb-03 6:20
anon12317-Feb-03 6:20 
Questionhow to use WTL to create a control ? Pin
SinoPeterWang25-Nov-02 21:39
SinoPeterWang25-Nov-02 21:39 
QuestionHow use it In Web Explorer Pin
Johnson Chen5-Oct-02 5:29
Johnson Chen5-Oct-02 5:29 
AnswerRe: How use it In Web Explorer Pin
Derick Cyril Thomas12-Oct-02 21:44
Derick Cyril Thomas12-Oct-02 21:44 
QuestionHow use it In Web Explorer Pin
Johnson Chen5-Oct-02 5:10
Johnson Chen5-Oct-02 5:10 
QuestionA bit stubborn, isnt it? Pin
Andreas Saurwein16-Sep-02 0:06
Andreas Saurwein16-Sep-02 0:06 
GeneralRepaint problem... Pin
John Johansson15-Sep-02 23:28
John Johansson15-Sep-02 23:28 
GeneralNicely Done Pin
Ed Gadziemski14-Sep-02 4:05
professionalEd Gadziemski14-Sep-02 4:05 
GeneralRe: Nicely Done Pin
Derick Cyril Thomas14-Sep-02 18:05
Derick Cyril Thomas14-Sep-02 18:05 

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.