Click here to Skip to main content
15,867,686 members
Articles / Desktop Programming / MFC

XP-style Button Control

Rate me:
Please Sign up or sign in to vote.
4.65/5 (21 votes)
6 Aug 2002 552.1K   6.4K   64   38
XP style button control for all version of windows.

Sample Image

Introduction

Here is an XP-style Button. It works on all windows OSs: 95/98/Me/NT/W2K/XP. No subclassing, etc. is needed to use this control - it's just a plain simple button control. This code is a modified form of the OCX code I recently saw on codeguru. The button code was for an ActiveX control. I created this CButton derived class with latest Microsoft's sponsored CCP technology (Cut-Copy-Paste).

How to Use It?

  • In your resource editor, create a button and set the 'owner draw' property.
  • Use classwizard to create a CButton object in your dialog.
  • Include the "xpbutton.h" file in your dialog class file.
  • Rename the CButton object type to CXPButton.
  • Compile and enjoy.

History

  • 7th August, 2002 - Updated download

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
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionProblems compiling with VS2012 Pin
merano21-Apr-13 5:33
merano21-Apr-13 5:33 
AnswerRe: Problems compiling with VS2012 Pin
VincyChan21-Dec-14 15:10
professionalVincyChan21-Dec-14 15:10 
QuestionWhat about the non rounded frame around the button? Pin
agua28-Apr-09 10:57
agua28-Apr-09 10:57 
Generalgreat work Pin
ibrahim_8428-Jul-08 23:53
ibrahim_8428-Jul-08 23:53 
Generalapologies Pin
MKMA23-Nov-07 3:37
MKMA23-Nov-07 3:37 
Generalproblem if init dialog is used Pin
MKMA23-Nov-07 3:22
MKMA23-Nov-07 3:22 
QuestionWho has the CXPEdit? Pin
aimar26623-Apr-06 4:10
aimar26623-Apr-06 4:10 
GeneralNice Pin
Alton Williams29-Jun-05 3:21
Alton Williams29-Jun-05 3:21 
GeneralToolTips Pin
paramecula16-Mar-05 2:19
paramecula16-Mar-05 2:19 
Generallittle bug Pin
HarborHu3-Mar-05 19:39
HarborHu3-Mar-05 19:39 
GeneralRe: little bug Pin
KiwiDi12-Apr-05 21:09
KiwiDi12-Apr-05 21:09 
GeneralRe: little bug Pin
v1ncent1-Jun-05 11:11
v1ncent1-Jun-05 11:11 
QuestionWhat bout other Controls... Pin
Manoj Singh K18-Jan-05 19:18
Manoj Singh K18-Jan-05 19:18 
GeneralInvisible Pin
Member 6808284-Jul-04 7:24
Member 6808284-Jul-04 7:24 
If I create XP buttons in my own workspace I can't see the buttons but I can click on it. What's wrong?
GeneralFix For Font example, chinese. Pin
anonymousafsdfasd15-May-04 3:58
sussanonymousafsdfasd15-May-04 3:58 
GeneralFix For Font example, chinese. Pin
Anonymous15-May-04 3:58
Anonymous15-May-04 3:58 
GeneralLittle BUG fix Pin
Ivo Wubbels23-Apr-04 1:31
Ivo Wubbels23-Apr-04 1:31 
Generalnice going. Pin
t2di4u28-Jan-04 19:11
t2di4u28-Jan-04 19:11 
GeneralWhy there is no XP-style Edit Pin
Eureka Jim16-Dec-03 13:44
Eureka Jim16-Dec-03 13:44 
QuestionHow can I set the button colors? Pin
Bobboots22-Aug-03 10:36
Bobboots22-Aug-03 10:36 
Generalhwo can i set icon Pin
liquidsnake18329-Apr-03 8:28
liquidsnake18329-Apr-03 8:28 
QuestionWhat about xp titlebar? Pin
anon1231-Mar-03 10:46
anon1231-Mar-03 10:46 
QuestionHow can I get change the font on the CXPButton? Pin
Jaltair13-Feb-03 14:58
Jaltair13-Feb-03 14:58 
AnswerRe: How can I get change the font on the CXPButton? Pin
jerry0davis14-Feb-03 0:51
jerry0davis14-Feb-03 0:51 
GeneralRe: How can I get change the font on the CXPButton? Pin
Jaltair18-Feb-03 6:04
Jaltair18-Feb-03 6:04 

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.