Percentage Progessbar

  • Thread starter Thread starter Guest
  • Start date Start date
by default the value range is a percentage (min = 0 and max = 100)
 
jez123456 said:
Hi

Is there anyway to display the percentage value completed in a Progressbar.
I've found a Microsoft link
http://support.microsoft.com/default.aspx/kb/323116/EN-US/
to create a smooth progessbar but there is no percent propery.

Thanks

Inside the Value() method, call another (new) method to calculate the
percentage, build the representing string and paint the representig string
onto the appropriate position inside Value()'s newValueRect. You might want
to introduce a new property for the color to use (like
"percentageStringColor" similar to ProgressBarColor. Be sure to invalidate
the area you paint the String on.

HTH
Michael
 
Michael said:
Inside the Value() method, call another (new) method to calculate the

Oops...
Use the OnPaint() method instead of the Value() method.
percentage, build the representing string and paint the representig string
onto the appropriate position inside Value()'s newValueRect.

You might use this.ClientRectangle instead
And add another Property for the text font.
 
or just say:
myProgressBar.Value = (int) ( percentage * 100 );

;o)
 
Dan said:
or just say:
myProgressBar.Value = (int) ( percentage * 100 );

;o)

I don't see why this would make the ProgressBar display the string "43%"...
 

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

Back
Top