Click here to Skip to main content
Licence 
First Posted 1 Oct 2005
Views 206,196
Bookmarked 219 times

Fully Customizable XP Progress Bar (with examples)

By | 5 Nov 2005 | Article
A progress bar like the WinXP progress bar control, but completely customizable.

Introduction

I've developed an XpProgressBar that looks like the one used by the default WinXP theme. I have added a lot of features to fully customize its look.

Very important !!!

If you update the position of the progress bar in a tight loop or in a CPU intensive area and you feel that the bar is not repainted, use the following code in the place where you have problem:

Application.DoEvents();

Please don't use Invalidate(), .Refresh() or .Update(). This can result in low performance and sometimes these don't work.

XpProgressBar features

The control offers the following features:

  • Good performance

    The XpProgressBar doesn't use much of the CPU because it uses a double buffer feature that performs painting operations offline to an image and later to the screen (this works at least three times faster).

  • Non flicking double buffer

    This control is implemented with a double buffer to provide smooth animation without any flicking and small paint time.

  • Anti alias text

    All the strings painted in the progress bar are drawn using anti alias hint to provide better quality.

  • Text shadow

    You can set the shadow to the text and customize its color and the alpha channel.

  • Fully customizable

    As you can see, every property of the progress bar can be set to provide a beautiful look.

The properties of the control:

  • BackgroundImage
  • ColorBackground
  • ColorBarBorder
  • ColorBarCenter
  • ColorsXp

    Reset the colors to WinXP default.

  • ColorText
  • GradientStyle
  • SteepDistance
  • SteepWidth
  • TextShadow
  • TextShadowAlpha

GradientStyle

You can set the GradientStyle property to obtain some of these styles:

Animation sample

The following picture shows an animation sample with different timers and looks:

License

The control and the source code are completely free for commercial and non commercial use.

History

  • 2005-10-1: Article submitted.
    • 1.5
      • Improved the performance of Paint algorithms.
      • Alpha text
      • The image on the ProgressBar looks like a logo (with alpha of course, jeje).
      • Can disable Anti Alias Text.
    • 2.0
      • Vertical ProgressBar (not only horizontal)
      • Text align
      • Border color

Updates

Visit my page Marcos Meli and come back with updates soon.

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

About the Author

Marcos Meli

Software Developer (Senior)

Argentina Argentina

Member

Marcos Meli v1.0 was released at august of 1980 by Francisco and Mabel Inc.
He´s from Bahia Blanca, Argentina.
 
He enjoy developing from the 12 years, has a degree in Computer Science, and of course, love this site and .NET in general.
 
He is the lead developer of the FileHelpers Library.
 
Marcos is also the co-funder of Devoo.Net.
A company that provides Object Oriented Components & Libraries for .NET developers (mostly open source)

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralRe: Problem with anchor property PinmemberBengie21:58 24 Feb '07  
GeneralSimply Brilliant PinmemberKiaT217:00 5 Nov '06  
GeneralRe: Simply Brilliant PinmemberMarcos Meli2:12 8 Nov '06  
GeneralNice Work [modified] Pinmembergrep29:14 22 Jul '06  
GeneralRe: Nice Work PinmemberMarcos Meli9:26 22 Jul '06  
GeneralRe: Nice Work Pinmembernkxiawu16:41 3 Oct '06  
QuestionHow to auto change the text color? Pinmemberyazoox18:27 27 Mar '06  
I find out that the text color will not change when the progressbar run.
For example, the background is white, and the text color is black, the color of progress bar is blue, when the progress bar run to overlop the text, I think the text color should be changed to white or other color which you set in properties. At least, I think, this function is needed.
 
I don't know if you can catch what I said.
 
Thanks a lot.
 
BTW: The progres bar is wonderful.
Smile | :)
AnswerRe: How to auto change the text color? PinmemberMarcos Meli2:57 28 Mar '06  
GeneralFantastic! Pinmemberverosystems6:55 24 Mar '06  
GeneralRe: Fantastic! PinmemberMarcos Meli10:45 24 Mar '06  
QuestionChanging the Start Position PinmemberJonathan Merriweather2:43 28 Feb '06  
AnswerRe: Changing the Start Position PinmemberMarcos Meli10:42 24 Mar '06  
GeneralRe: Changing the Start Position PinmemberJonathan Merriweather18:56 24 Mar '06  
QuestionUsing as a trackBar? PinmembertheTron7:21 6 Feb '06  
AnswerRe: Using as a trackBar? PinmembertheTron8:30 6 Feb '06  
GeneralPerfect! Pinmembersparky9096:28 13 Jan '06  
GeneralRe: Perfect! PinmemberGreg the Grip18:43 24 Jan '06  
AnswerRe: Perfect! PinmemberMarcos Meli7:04 25 Jan '06  
GeneralRe: Perfect! PinmemberGreg the Grip13:58 25 Jan '06  
GeneralThanks ! Pinmemberdapoussin5:13 23 Dec '05  
GeneralRe: Thanks to you PinmemberMarcos Meli7:05 25 Jan '06  
QuestionVertical? PinmemberBoeroBoy5:20 6 Dec '05  
AnswerRe: Vertical? PinmemberMarcos Meli9:35 6 Dec '05  
AnswerRe: Vertical? PinmemberDesaBoy1:24 11 Jan '06  
GeneralApplication.DoEvents is not the answer! Pinmemberekriel6:05 28 Nov '05  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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 | Mobile
Web03 | 2.5.120529.1 | Last Updated 5 Nov 2005
Article Copyright 2005 by Marcos Meli
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid