Percentage Progessbar

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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%"...
 
Back
Top