Click here to Skip to main content
12,897,431 members (49,148 online)
Click here to Skip to main content
Add your own
alternative version


43 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

GeneralMy vote of 1 Pin
bboy_markor24-Apr-12 14:35
memberbboy_markor24-Apr-12 14:35 
GeneralProgressbar shape trapezium Pin
NRG568-Apr-07 23:25
memberNRG568-Apr-07 23:25 
GeneralRe: Progressbar shape trapezium Pin
Gil.Schmidt10-Apr-07 11:45
memberGil.Schmidt10-Apr-07 11:45 
GeneralProblem with Whidbey: percent text is not centralized Pin
hungpvtn14-Jan-06 23:47
memberhungpvtn14-Jan-06 23:47 
GeneralRe: Problem with Whidbey: percent text is not centralized Pin
Gil_Schmidt15-Jan-06 0:11
memberGil_Schmidt15-Jan-06 0:11 

i'm sending a fixed .Net 2.0 version right now but you can change this function to:
		<br />
private void DrawPercent(Graphics G)<br />
{<br />
     SizeF TextSize = G.MeasureString(Text,Font);<br />
     SolidBrush TextBrush = new SolidBrush(ForeColor);<br />
     float Left, Top;<br />
<br />
     Left = (Width - TextSize.Width) / 2;<br />
     Top = (Height - TextSize.Height) / 2;<br />
                 <br />
     G.DrawString(<br />
         Text,<br />
         Font,<br />
         TextBrush,<br />
         new PointF(Left, Top));<br />
<br />
     TextBrush.Dispose();<br />
}<br />

also update this propertie:

<br />
public int Position<br />
{<br />
	get { return _Position; }<br />
	set <br />
        { <br />
		if (value > 100) return; <br />
		if (value < 0) return;<br />
		<br />
		_Position = value;<br />
                Text = _Position + "%";<br />
		this.Invalidate();<br />
	}<br />
}<br />

thanks for the commet.. Gil
GeneralUse in VB .NET Pin
kenexcelon27-Aug-05 17:15
memberkenexcelon27-Aug-05 17:15 
GeneralRe: Use in VB .NET Pin
kenexcelon27-Aug-05 17:16
memberkenexcelon27-Aug-05 17:16 
GeneralRe: Use in VB .NET Pin
Gil_Schmidt28-Aug-05 0:50
memberGil_Schmidt28-Aug-05 0:50 
GeneralRe: Use in VB .NET Pin
kenexcelon28-Aug-05 5:18
memberkenexcelon28-Aug-05 5:18 
GeneralRe: Use in VB .NET Pin
Gil_Schmidt28-Aug-05 10:22
memberGil_Schmidt28-Aug-05 10:22 

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
Web02 | 2.8.170424.1 | Last Updated 24 Jan 2006
Article Copyright 2005 by Gil.Schmidt
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid