VBdotnet2005
asked on
Progress bar
how can I display percentage of progress bar?
Me.ProgressBar1.Minimum = 0
Me.ProgressBar1.Maximum = GetCountmyfiles()
Me.ProgressBar1.Value = 1
Me.ProgressBar1.Step = 1
For Each Filex In myDir.GetFiles
Me.ProgressBar1.PerformSte p()
myfile.move(mypath)
me.mylable1.txt = ????
next
Me.ProgressBar1.Minimum = 0
Me.ProgressBar1.Maximum = GetCountmyfiles()
Me.ProgressBar1.Value = 1
Me.ProgressBar1.Step = 1
For Each Filex In myDir.GetFiles
Me.ProgressBar1.PerformSte
myfile.move(mypath)
me.mylable1.txt = ????
next
ASKER
dim CountProbar as integer = 0
For Each myfile In myDir.GetFiles
CountProbar += 1
Me.ProgressBar1.PerformSte p()
Me.TextBox2.Text = "In progress... " & CInt(ProgressBar1.Value _ /ProgressBar1.Maximum * 100)
next
For Each myfile In myDir.GetFiles
CountProbar += 1
Me.ProgressBar1.PerformSte
Me.TextBox2.Text = "In progress... " & CInt(ProgressBar1.Value _ /ProgressBar1.Maximum * 100)
next
ASKER
Idle_Mind:,
Obove code does not work for me...
Obove code does not work for me...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Either...
(1) Change to an indexed For Loop.
(2) Use a seperate "counter" variable that you manually increment after each iteration
(3) Use the Value property of the ProgressBar:
ProgressBar1.PerformStep()
Label11.Text = CInt(ProgressBar1.Value / ProgressBar1.Maximum * 100)