Click here to Skip to main content
12,551,901 members (51,840 online)
Click here to Skip to main content
Add your own
alternative version


54 bookmarked

Vertical ProgressBar

, 1 Nov 2007
Rate this:
Please Sign up or sign in to vote.
A vertical progressbar inherited from UserControl.

Sample Image - verticalprogressbar.jpg


This is a very simple progress bar inherited from System.Windows.Forms.UserControl. The System.Windows.Forms.ProgressBar is only horizontal. And I cannot find a vertical version of a progress bar. I implemented this vertical progress bar with the same behavior as the horizontal progress bar. For my personal purpose, I provided this vertical progress bar with some enhanced features. First, the bar color can be changed by Color property. Second, the bar can be set to solid by setting Style property to Styles.Solid. The last feature is that the vertical progress bar can be borderless by setting BorderStyle property to BorderStyles.None.


The code is very simple. The Styles and BorderStyles enums are defined as:

public enum Styles
    Classic, // same as ProgressBar
public enum BorderStyles
    Classic, // same as ProgressBar

The VerticalProgressBar class is inherited from UserControl class. You can specify a particular image by using the ToolboxBitmapAttribute class. Here, I used the same image as the ProgressBar.

[Description("Vertical Progress Bar")]
public sealed class VerticalProgressBar : System.Windows.Forms.UserControl
    ...    ...

For convenience, all of the vertical progress bar properties are organized into VerticalProgressBar category on the property window of Visual Studio .NET, using Category attribute.

[Description( "VerticalProgressBar Maximum Value")]
[Category( "VerticalProgressBar" )]
public int Maximum
    return m_Maximum;
    m_Maximum = value;
    if(m_Maximum < m_Minimum)
        if(m_Maximum < m_Value)
                m_Value = m_Maximum;

... ...

OnPaint function was overridden to draw bar and border if needed.

protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
    Graphics dc = e.Graphics;
    //Draw Bar

    //Draw Border


Using the Code

To use this vertical progress bar, copy the VerticalProgressBar.dll under your project directory. Then choose Add/Remove Items.. on the context menu of toolbox pane, and select this file to add this control to the toolbox. It will show the same icon as the ProgressBar. Then you can use it as same as ProgressBar. The default properties of this vertical progress bar are set to the same as the ProgressBar. You can change Color, Style, and BorderStyle properties as you need.


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

Jiajun Lu
Web Developer
United States United States
I started programming 10 years ago on a 80286 PC with dbase system. Now, I am a graduate student of Texas A&M University. I am working on the research on Collaborative Systems. My works are on both Windows and Linux platform in C/C++ programming languages. I am pretty interested in .NET frameworks and C#, and adapt some works on .NET frameworks.

You may also be interested in...


Comments and Discussions

QuestionFrom Top or Bottom Pin
tito.gnap31-Aug-16 3:33
membertito.gnap31-Aug-16 3:33 
GeneralVisual Styles Pin
Member 1023631813-Jun-16 7:23
memberMember 1023631813-Jun-16 7:23 
Generalappreciated Pin
Member 1041477627-Dec-13 23:39
memberMember 1041477627-Dec-13 23:39 
QuestionVerticalProgressBar does not appear in the toolbox Pin
petrus bitbyter17-Apr-12 3:13
memberpetrus bitbyter17-Apr-12 3:13 
GeneralMy vote of 5 Pin
John Smith Becera18-Oct-10 22:48
memberJohn Smith Becera18-Oct-10 22:48 
GeneralTop Down Progress [modified] Pin
Hamsterhead200123-Mar-08 17:14
memberHamsterhead200123-Mar-08 17:14 
JokeRe: Top Down Progress Pin
Ingenious00117-Jun-08 23:39
memberIngenious00117-Jun-08 23:39 
GeneralNice Pin
Paul Conrad4-Nov-07 7:50
memberPaul Conrad4-Nov-07 7:50 
GeneralVisualStyles Pin
The_Mega_ZZTer2-Nov-07 9:55
memberThe_Mega_ZZTer2-Nov-07 9:55 
GeneralUpdated Pin
Jiajun Lu2-Nov-07 3:06
memberJiajun Lu2-Nov-07 3:06 
GeneralRe: Updated Pin
Member 61050225-Jun-09 20:03
memberMember 61050225-Jun-09 20:03 
GeneralDerive from Control, not UserControl Pin
SAKryukov23-Oct-07 6:42
memberSAKryukov23-Oct-07 6:42 
GeneralRe: Derive from Control, not UserControl Pin
norm .net2-Nov-07 1:49
membernorm .net2-Nov-07 1:49 
GeneralRe: Derive from Control, not UserControl Pin
The_Mega_ZZTer2-Nov-07 9:48
memberThe_Mega_ZZTer2-Nov-07 9:48 
GeneralRe: Derive from Control, not UserControl Pin
norm .net4-Nov-07 20:36
membernorm .net4-Nov-07 20:36 
GeneralRe: Derive from Control, not UserControl Pin
John Simmons / outlaw programmer25-Nov-07 2:57
mvpJohn Simmons / outlaw programmer25-Nov-07 2:57 
Questionhow we differentiate word dll version Pin
ram on c#11-Jun-07 21:41
memberram on c#11-Jun-07 21:41 
QuestionMultiple Color Pin
Reza Shojaie14-May-07 2:34
memberReza Shojaie14-May-07 2:34 
AnswerRe: Multiple Color Pin
Jiajun Lu2-Nov-07 3:09
memberJiajun Lu2-Nov-07 3:09 
QuestionCan I use it on VB .net? Pin
Member #382687913-Feb-07 17:06
memberMember #382687913-Feb-07 17:06 
AnswerRe: Can I use it on VB .net? Pin
Paul Conrad4-Nov-07 7:49
memberPaul Conrad4-Nov-07 7:49 
GeneralWindows Vertical Progressbar Pin
reflex@codeproject24-Sep-06 13:49
memberreflex@codeproject24-Sep-06 13:49 
AnswerRe: Windows Vertical Progressbar Pin
GLMnet2-Aug-07 9:31
memberGLMnet2-Aug-07 9:31 
GeneralMin. > 0 Pin
keith.h14-Sep-06 21:23
memberkeith.h14-Sep-06 21:23 
GeneralInfinite Loop Pin
teeinep11-Jul-06 3:14
memberteeinep11-Jul-06 3:14 

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.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161021.1 | Last Updated 1 Nov 2007
Article Copyright 2004 by Jiajun Lu
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid