Step 1:
Open a Visual Basic project.
Double-click the "Progress Bar" control on the toolbar to add "ProgressBar1" to the form.
Double-click the "Button" control to add "Button1" to the form.
Step 2
Press "F7" to open the code window. Open the "Form1_Load" subroutine and type the following:
ProgressBar1.Minimum = 0
ProgressBar1.Maximum = 5
ProgressBar1.Value = 0
This code sets the starting values for the progress variable, as well as the minimum, maximum and current values for the progress bar. You can set a different maximum value depending on what you need the progress bar for.
Step 3:
Open the "Button1_Click" subroutine and type the following:
If ProgressBar1.Value < ProgressBar1.Maximum Then
ProgressBar1.Value += 1
If ProgressBar1.Value = ProgressBar1.Maximum Then
MsgBox("Finished!")
End If
End If
------------------------------------------------
Learn throughout life
Thiru, if this helps please login to Mark As Answer. |
Reply | Alert Moderator