By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,563 Members | 1,724 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,563 IT Pros & Developers. It's quick & easy.

Percentage Progessbar

P: n/a
Hi

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

Thanks
Nov 16 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
The Value property accepts a 0-100 value.
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"jez123456" <je*******@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
Hi

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

Thanks

Nov 16 '05 #2

P: n/a
by default the value range is a percentage (min = 0 and max = 100)
"jez123456" <je*******@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
Hi

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

Thanks

Nov 16 '05 #3

P: n/a
jez123456 wrote:
Hi

Is there anyway to display the percentage value completed in a Progressbar. I've found a Microsoft link
http://support.microsoft.com/default.../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
Nov 16 '05 #4

P: n/a
Michael Voss wrote:
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.
Nov 16 '05 #5

P: n/a

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

;o)

"Michael Voss" <mi**********@lvrREMOVE.deCAPS> wrote in message
news:422c7f8c@news...
Michael Voss wrote:
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.

Nov 16 '05 #6

P: n/a
Dan Bass wrote:

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

;o)


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

-----------------------------------------------
|###################| 43 % |
-----------------------------------------------
Am I missing something ?
Nov 16 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.