Click here to Skip to main content
13,350,289 members (47,084 online)
Click here to Skip to main content
Add your own
alternative version


44 bookmarked
Posted 8 Feb 2005

Advanced Progressbar

, 24 Jan 2006
Rate this:
Please Sign up or sign in to vote.
An extended progress bar with support for shape based progress bars and 3D colors.

Advanced Progressbar sample

Advanced Progressbar sample


This article explains an extended progress bar with support for shape based progress bars and 3D colors.


The first version only included a basic rectangle progress bar with "3D" abilities and percent display. I decided to add a dynamic shape function so it could be used with any shape (you can add more shapes in the CreateRegion function).

Using the code

Just place it on the form and have a look at the properties:

  • FillingMethod - the direction of the gradient (right to left, left to right..).
  • GradientMethod - the way the gradient is drawn (Horizontal, Vertical, 3D).
  • Shape - the shape of the progress bar (rectangle, ellipse, rounded rectangle, triangle, magen david, snake).

Other stuff you should have a look at are: BorderSize, BorderDisplay, and PercentDisplay.

Points of Interest

Good progress bars are easy to find today, but I wrote this one because I didn't find one that I liked that supported percents display, and the rest is history.


The first version only included a simple rectangle progress bar and was written very specifically for rectangle. Later, I wanted to add one more style, and I decided to write it dynamically for any shape. This is an updated version fixed for .NET 2.0.


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


About the Author

Team Leader
Israel Israel
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralProblem with Whidbey: percent text is not centralized Pin
hungpvtn15-Jan-06 0:47
memberhungpvtn15-Jan-06 0:47 
The control was working well when I was using VS2003 and .NET 1.1. I have just switched to VS2005/.Net 2.0 and the percent text is not centralized.
I have tried to make to modifications to fix it. Here is the code:

private void DrawPercent(Graphics G)
// very ugly way to do it, but it works well
Label PercentLabel = new Label();
PercentLabel.AutoSize = true;
PercentLabel.Font = this.Font;
PercentLabel.Text = _Position.ToString() + "%";

SizeF TextSize = G.MeasureString(PercentLabel.Text, this.Font);

float left = this.ClientRectangle.X + (this.ClientRectangle.Width - TextSize.Width) / 2;
float top = this.ClientRectangle.Y + (this.ClientRectangle.Height - TextSize.Height) / 2;

SolidBrush mTextBrush = new SolidBrush(this.ForeColor);
G.DrawString(PercentLabel.Text, this.Font, mTextBrush, left, top);

GeneralRe: Problem with Whidbey: percent text is not centralized Pin
Gil_Schmidt15-Jan-06 1:11
memberGil_Schmidt15-Jan-06 1:11 

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.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180111.1 | Last Updated 24 Jan 2006
Article Copyright 2005 by Gil.Schmidt
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid