I'd like to do two things on my progress bar.
- Change the green colour to red.
- Remove the blocks and make it in one color.
Any information about those two things I wonder how to accomplish will be greatfuly appreaciated!
Thanks.
.net-3.5cnetwinforms
I'd like to do two things on my progress bar.
Any information about those two things I wonder how to accomplish will be greatfuly appreaciated!
Thanks.
Best Answer
OK, it took me a while to read all the answers and links. Here's what I got out of them:
Sample Results
The accepted answer disables visual styles, it does allow you to set the color to anything you want, but the result looks plain:
Using the following method, you can get something like this instead:
How To
First, include this if you haven't:
using System.Runtime.InteropServices;
Second, you can either create this new class, or put its code into an existing
static
non-generic class:Now, to use it, simply call:
progressBar1.SetState(2);
Note the second parameter in SetState, 1 = normal (green); 2 = error (red); 3 = warning (yellow).
Hope it helps!