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.
thanks for the compliments. i think it is a good tutorial for beginning visual basic coders
Nice and simple. Good tut. I posted something like this a while back
Originally Posted by XGelite
Nice and simple. Good tut. I posted something like this a while back
He's "new" in this section and can't know everything
Again, This falls under the "Simple" or "Basic" One Tut Suggestion
Nice! For deleting or gathering data files you can do something like:
'Load how many files that are going to get deleted.
For each file as string in my.computer.filesystem.getfiles("C:\")
ProgressBar1.Maximum = ProgressBar1.Maximum + 1
Next
'Update the progress bar as you delete...
For each delfile as string in my.computer.filesystem.getfiles("C:\")
Try
My.computer.filesystem.removefile(delfile) 'IDK if that is the correct syntax
ProgressBar1.value = ProgressBar1.value + 1
Catch
End Try
Next
IDK something like that... I had to free hand it so the syntax is probably off by a bit. Hope this helps some people.