65.9K
CodeProject is changing. Read more.
Home

Enhanced XP Button

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.37/5 (26 votes)

Dec 10, 2003

1 min read

viewsIcon

192036

downloadIcon

2737

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.