How to display the Progress (%) in the middle of a Progress Bar...

G

Guest

Hi Everyone

Can anyone tell me how can I display the progress in percentage in the
middle of the progress bar with "invert color" using VB.NET, this is very
common and available with most of the applications, like

at the begining the text "0%" is shown in black text and the background
color of the progress bar is white

and at the end, when the progress bar is filled with blue color then the
"100%" text is in white color

when the progress is in the middle that is "50%" then "5" appears in white
color and "0%" appears in black color

I want to have this type of effects

Thanks
 
M

Morten Wennevik

Hi kajol,

I did something just like that using my own ProgressBar once.
If I remember how I did it, I believe you need to handle the Paint procedure and do two sets of FillRectangle and DrawStrings with opposite colors. The size of the rectangles followed the progress. I think SystemColors.Desktop is the default progressbar color.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top