Click here to Skip to main content
15,885,366 members
Articles / Programming Languages / C#
Article

Enhanced XP Button

Rate me:
Please Sign up or sign in to vote.
3.37/5 (26 votes)
9 Dec 20031 min read 190.1K   2.7K   78   20
Enhanced XP Button

Introduction

The enhanced XP style button is very easy to use and it supports Rectangle, Circle or Ellipse shape with image and different colors. This control also inherits most of the properties from Forms.Button.

This control is created based on Joaqs’s XP button in his Windows XP-like Controls. I add the properties BtnStyle, BtnShape and made the properties Image and ImageAlign work for this control. The reason that I selected Joaqs’s XP button to work is that the button inherited from Forms.Button and it has the basic XP button functions. So I got the authorization from the Joaqs to add some more features and post it for the people who like it.

Link

Usage

  1. Add the control to the Toolbox.
  2. Drop the control to the WinForm.
  3. Select the properties:
    • BtnStyle : Default, Blue, Olivegreen, Silver for different looks
    • BtnShape: Rectangle and Ellipse (if you set the size of the button as a square you get a circle button)
    • Image: load the image for the button.
    • ImageAlign: to set the layout of the image. (only supports MiddleLeft, MiddleRight, TopCenter and Center)

You can still adjust the image location by changing the property value of the of AdjustImageLocation to move the image around until you are satisfied.

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

 
QuestionCan't dowmload Pin
hyman_yang23-Apr-14 4:16
professionalhyman_yang23-Apr-14 4:16 
GeneralImage problem Pin
hkrnic9-Jul-06 1:00
hkrnic9-Jul-06 1:00 
QuestionQuick Question? Pin
M@dHatter20-Nov-05 14:31
M@dHatter20-Nov-05 14:31 
GeneralCan't download source code Pin
gp_mk3-Jan-05 22:10
gp_mk3-Jan-05 22:10 
QuestionHow to use it? Pin
Weiye Chen19-Feb-04 17:07
Weiye Chen19-Feb-04 17:07 
AnswerRe: How to use it? Pin
Weiye Chen19-Feb-04 20:59
Weiye Chen19-Feb-04 20:59 
GeneralResource Issue Pin
draellix19-Jan-04 5:39
draellix19-Jan-04 5:39 
GeneralBuild Errors Pin
mikeperetz17-Dec-03 12:30
mikeperetz17-Dec-03 12:30 
Generalbuild Errors Pin
csadler15-Dec-03 3:48
csadler15-Dec-03 3:48 
Hi
I tried to use this control (pulled it in from the toolbox to my form. Built and ran fine. When I Selected the form again (was looking at the code), I got this series of errors.

They also appeared when I built the applciation (the second time). I'm using Dev Studio 2003.

C:\DotNetWork\ASA\asaSports\PointOfInterest\POInterestConfig.cs(769): The variable 'XPStyle' is either undeclared or was never assigned.

C:\DotNetWork\ASA\asaSports\PointOfInterest\POInterestConfig.cs(768): The variable 'BtnShape' is either undeclared or was never assigned.

The Generated code was:

this.browseMapButton1.AdjustImageLocation = new System.Drawing.Point(0, 0);
this.browseMapButton1.BtnShape = MyXPButton.emunType.BtnShape.Rectangle;
this.browseMapButton1.BtnStyle = MyXPButton.emunType.XPStyle.Default;
this.browseMapButton1.Image = ((System.Drawing.Image)(resources.GetObject("browseMapButton1.Image")));



It looks like the same problem that the Pinkie XP Button controls have. I'm going to try and debug, but if anyone has the answer it would be appreciated.

Thanks

Chris

GeneralRe: build Errors Pin
Michael D Bray15-Dec-03 4:26
Michael D Bray15-Dec-03 4:26 
GeneralRe: build Errors Pin
csadler15-Dec-03 12:51
csadler15-Dec-03 12:51 
GeneralRe: build Errors Pin
xiao hong27-Feb-04 1:58
xiao hong27-Feb-04 1:58 
GeneralRe: build Errors Pin
ooooscar6-Sep-05 5:15
ooooscar6-Sep-05 5:15 
GeneralRe: build Errors Pin
WebMaster10-Mar-06 6:29
WebMaster10-Mar-06 6:29 
GeneralVery important question! Pin
Abbas_Riazi9-Dec-03 22:40
professionalAbbas_Riazi9-Dec-03 22:40 
GeneralRe: Very important question! Pin
Daniel Turini9-Dec-03 23:06
Daniel Turini9-Dec-03 23:06 
GeneralRe: Very important question! Pin
Balkrishna Talele10-Dec-03 22:43
Balkrishna Talele10-Dec-03 22:43 
GeneralRe: Very important question! Pin
unitrunker11-Dec-03 23:16
unitrunker11-Dec-03 23:16 
GeneralRe: Very important question! Pin
Member 26118813-Dec-03 8:24
Member 26118813-Dec-03 8:24 
GeneralRe: Very important question! Pin
Almighty Bob10-Feb-04 11:38
Almighty Bob10-Feb-04 11:38 

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.