Click here to Skip to main content
15,868,016 members
Articles / Multimedia / GDI+
Article

Advanced Progressbar

Rate me:
Please Sign up or sign in to vote.
3.00/5 (24 votes)
24 Jan 20061 min read 126.5K   1.9K   45   24
An extended progress bar with support for shape based progress bars and 3D colors.

Advanced Progressbar sample

Advanced Progressbar sample

Introduction

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

Background

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.

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.

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

Comments and Discussions

 
GeneralMy vote of 1 Pin
Murhaf Suz24-Apr-12 14:35
Murhaf Suz24-Apr-12 14:35 
GeneralProgressbar shape trapezium Pin
Gebov8-Apr-07 23:25
Gebov8-Apr-07 23:25 
GeneralRe: Progressbar shape trapezium Pin
Gil.Schmidt10-Apr-07 11:45
Gil.Schmidt10-Apr-07 11:45 
GeneralProblem with Whidbey: percent text is not centralized Pin
hungpvtn14-Jan-06 23:47
hungpvtn14-Jan-06 23:47 
GeneralRe: Problem with Whidbey: percent text is not centralized Pin
Gil.Schmidt15-Jan-06 0:11
Gil.Schmidt15-Jan-06 0:11 
GeneralUse in VB .NET Pin
kenexcelon27-Aug-05 17:15
kenexcelon27-Aug-05 17:15 
GeneralRe: Use in VB .NET Pin
kenexcelon27-Aug-05 17:16
kenexcelon27-Aug-05 17:16 
GeneralRe: Use in VB .NET Pin
Gil.Schmidt28-Aug-05 0:50
Gil.Schmidt28-Aug-05 0:50 
GeneralRe: Use in VB .NET Pin
kenexcelon28-Aug-05 5:18
kenexcelon28-Aug-05 5:18 
GeneralRe: Use in VB .NET Pin
Gil.Schmidt28-Aug-05 10:22
Gil.Schmidt28-Aug-05 10:22 
GeneralRe: Use in VB .NET Pin
kenexcelon28-Aug-05 10:49
kenexcelon28-Aug-05 10:49 
GeneralRe: Use in VB .NET Pin
kenexcelon29-Aug-05 18:06
kenexcelon29-Aug-05 18:06 
GeneralRe: Use in VB .NET Pin
Gil.Schmidt29-Aug-05 21:46
Gil.Schmidt29-Aug-05 21:46 
GeneralRe: Use in VB .NET Pin
kenexcelon30-Aug-05 10:48
kenexcelon30-Aug-05 10:48 
Please check you hotmail as it was inserted into a mail message when you replied.

Thanks Poke tongue | ;-P
GeneralRe: Use in VB .NET Pin
Gil.Schmidt30-Aug-05 11:36
Gil.Schmidt30-Aug-05 11:36 
Questionhow to use in VB.NET??? Pin
Member 118023825-Aug-05 20:21
Member 118023825-Aug-05 20:21 
AnswerRe: how to use in VB.NET??? Pin
Gil.Schmidt25-Aug-05 22:16
Gil.Schmidt25-Aug-05 22:16 
GeneralRe: how to use in VB.NET??? Pin
Member 118023826-Aug-05 2:52
Member 118023826-Aug-05 2:52 
GeneralRe: how to use in VB.NET??? Pin
Gil.Schmidt26-Aug-05 5:58
Gil.Schmidt26-Aug-05 5:58 
GeneralRe: how to use in VB.NET??? Pin
The_Mega_ZZTer24-Jan-06 10:48
The_Mega_ZZTer24-Jan-06 10:48 
Generalcannot download the source code Pin
Bnaya Eshet20-Jul-05 21:48
Bnaya Eshet20-Jul-05 21:48 
QuestionWould you take a look? Pin
eRRaTuM30-May-05 4:25
eRRaTuM30-May-05 4:25 
GeneralSmoothing Mode Pin
romias9-Feb-05 0:50
romias9-Feb-05 0:50 
GeneralRe: Smoothing Mode Pin
Gil.Schmidt9-Feb-05 2:37
Gil.Schmidt9-Feb-05 2:37 

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.