|
-
Aug 6th, 2003, 04:11 AM
#1
Thread Starter
Registered User
Add percentage to ProgressBar
How can I add text that shows number of percentage completed into a ProgressBar, like most ProgressBar do?
please guide, thank you.
-
Aug 6th, 2003, 06:07 AM
#2
if you want to add percentage as in the numbers , try something like this (please note it's a quick rusty sample to show how to start off , nothing fancy ) :
VB Code:
[COLOR=blue]Private Sub[/color] Button2_Click([COLOR=blue]ByVal[/color] sender [COLOR=blue]As[/color] System.Object, [COLOR=blue]ByVal[/color] e [COLOR=blue]As[/color] System.EventArgs) [COLOR=blue]Handles[/color] Button2.Click
[COLOR=blue]Dim[/color] grp [COLOR=blue]As[/color] Graphics = ProgressBar1.CreateGraphics
[COLOR=blue]Dim[/color] x [COLOR=blue]As Integer[/color]
[COLOR=blue]For[/color] x = 10 [COLOR=blue]To[/color] ProgressBar1.Maximum
ProgressBar1.PerformStep()
grp.DrawString(x & "%", [COLOR=blue]New[/color] Font("Tahoma", 10), [COLOR=blue]New[/color] SolidBrush(Color.Blue), 10, 1)
Threading.Thread.Sleep(10)
[COLOR=blue]Next[/color]
[COLOR=blue]End Sub[/color]
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|