Click here to Skip to main content
6,595,854 members and growing! (19,004 online)
Email Password   helpLost your password?
Languages » C / C++ Language » General     Intermediate

Fully Customizable XP Progress Bar (with examples)

By Marcos Meli

A progress bar like the WinXP progress bar control, but completely customizable.
C#, VB.NET 1.1, Win2K, WinXP, Win2003VS.NET2003, Dev
Posted:1 Oct 2005
Updated:5 Nov 2005
Views:135,639
Bookmarked:188 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
91 votes for this article.
Popularity: 9.28 Rating: 4.74 out of 5
1 vote, 1.1%
1

2

3
20 votes, 22.0%
4
70 votes, 76.9%
5

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


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)
Occupation: Software Developer (Senior)
Location: Argentina Argentina

Other popular C / C++ Language articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 66 (Total in Forum: 66) (Refresh)FirstPrevNext
GeneralVertical Progress BAR Pinmemberandrew_1662:45 12 Jun '08  
Generalline on the progress Bar Pinmembermaornit5:04 6 Nov '07  
Generalthanks Pinmemberququer18:09 9 Sep '07  
Generalprogressbar on list view Pinmemberanu jaggi2:19 2 May '07  
GeneralTriggering the progressbar from backgroundworker PinmemberUltraWhack9:35 19 Apr '07  
GeneralThanks ! Pinmemberwick955:45 12 Apr '07  
GeneralGood Job PinmemberJeffro Bodine6:30 7 Apr '07  
GeneralREALLY GREAT! PinmemberSelecters5:45 13 Mar '07  
GeneralRe: REALLY GREAT! PinmemberMarcos Meli5:52 13 Mar '07  
GeneralMagnificent submission PinmemberHuntermonk887:11 21 Feb '07  
Generalpermission problems Pinmembermerrittholmes6:35 16 Feb '07  
GeneralCan't find Vertical ProgressBar (not only horizontal) Pinmembersilorenz0:54 31 Jan '07  
GeneralRe: Can't find Vertical ProgressBar (not only horizontal) PinmemberMarcos Meli8:13 31 Jan '07  
GeneralCan I Suggest a small improvement ? PinmemberTheDarkMan2:03 26 Jan '07  
GeneralRe: Can I Suggest a small improvement ? PinmemberMarcos Meli3:53 26 Jan '07  
GeneralRe: Can I Suggest a small improvement ? PinmemberTheDarkMan21:49 29 Jan '07  
GeneralThanks Pinmembernapo@burgasnet.com2:10 19 Jan '07  
GeneralRe: Thanks PinmemberMarcos Meli3:15 19 Jan '07  
GeneralMarquee mode Pinmemberroel_v19:01 20 Dec '06  
GeneralColorsXp PinmemberLupineRanger3:16 20 Dec '06  
GeneralRe: ColorsXp PinmemberMarcos Meli3:23 20 Dec '06  
QuestionA great submission! Pinmemberminart0:59 4 Dec '06  
GeneralProblem with anchor property PinmemberMorningkill5:48 6 Nov '06  
GeneralRe: Problem with anchor property PinmemberBengie22:58 24 Feb '07  
GeneralSimply Brilliant PinmemberKiaT218:00 5 Nov '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 5 Nov 2005
Editor: Rinish Biju
Copyright 2005 by Marcos Meli
Everything else Copyright © CodeProject, 1999-2009
Web21 | Advertise on the Code Project