How can I add text that shows number of percentage completed into a ProgressBar, like most ProgressBar do?
please guide, thank you.
Printable View
How can I add text that shows number of percentage completed into a ProgressBar, like most ProgressBar do?
please guide, thank you.
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]