codes for moving bar while indicating progress in percentage (1-100)

Recommended Answers

All 3 Replies

try this

Private Sub cmdStart_Click()
While ProgressBar1.Value < ProgressBar1.Max
Do
ProgressBar1.Value = ProgressBar1.Value + 1
text1.Text = (ProgressBar1.Value / ProgressBar1.Max) * 100 & "%"
Loop
Wend
End Sub

Hi Masterace,

First change your field to numeric (for eg. 50% to 50) then you use below code.

ProgressBar1.Value = txtProgress.Text

in the above code txtProgress is the assumed text box in which your indicated progress is displayed.

Good Luck

Private Sub Form_Load()

Timer1.Enabled = False
ProgressBar1.Value = 0
Timer1_Timer
End Sub

Private Sub Timer1_Timer()

Timer1.Enabled = True

ProgressBar1.Value = ProgressBar1.Value + 1
ProgressBar1.Value & "%"
If ProgressBar1.Value >= 100 Then
' do whatever you want
Timer1.Enabled = False
End If

End Sub
Avinash Rooge
avirooge@yahoo.com

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.