Simple ProgressBar and Timer Tutorial
Credits all go to me for writing this.
What you need:
1 Button
1 Timer
1 Progress Bar
1 Label
1. Begin by double-clicking the form to view the code. Type in-
Code:
ProgressBar1.Visible = False
2. Double-click the button to view its code and type in your commands. It can be anythin, but include-
Code:
ProgressBar1.Show()
Timer1.Start
Label1.Text = ("Loading...")
3. Then double-click Timer1 to view its code. Type in-
Code:
ProgressBar1.Increment(Insert Value Here)
If ProgressBar1.Value = ProgressBar1.Maximum Then
Timer1.Stop()
Label1.Text = ("Done")
ProgressBar1.Visible = False
If you debug the program, it should show your progress bar loading at the increment you set it at.
If you want a file to be executed at a certain value of the ProgressBar, then you can do something like this-
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = "loading file"
ProgressBar1.Visible = True
ProgressBar1.Value = 25
Process.Start("C:\file.exe" )
Label1.Text = "loading file2"
ProgressBar1.Value = 50
Process.Start("C:\file2.exe" )
Label1.Text = "loading remaining files..."
ProgressBar1.Value = 100
Process.Start("C:\remaining.exe" )
End Sub
Attached below is my project file. It is a little bit different, but you should get the idea.
I hope this short tutorial is helpful!
Virus Scan: Virustotal. MD5: a995d511ba7a95715d88124fa2c8558a Suspicious.Insight
VirScan does not allow this to be scanned. sorry.