Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / multimedia / GDI+

A progress bar for everyone

1.71/5 (8 votes)
12 Feb 2007CPOL 1   741  
Another progress bar, but this one has differnt types, and allows text.

Sample image

Introduction

Why do we need another progress bar? We don't, but as long as there are different ways to do things, someone will think they can do it better.

The Code

The code is severely simple. All it does when you select a BarType, is use GDI+ drawing methods to create the progress bar. This makes it very easy to add other styles. If the WindowsStandard style is selected, it is drawn using the XPThemes DLL created by Dan Kackman (thanks).

The difference between this progress bar and others I've seen is that it has support for text, count, and percentages displayed on the bar itself. You can use the replicable item {0} for the count and/or the percentage so it will be placed where you want.

Hope it's useful. Happy progressing!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)