I have a little program in VB Express that I want to display a box with a progress bar. As the routine calls various subroutines, it would update the bat and text box.
{My Code Body minus the subroutines that are called}
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ProgressBar1.Minimum = 1 ' Progress Bar Minimum
ProgressBar1.Maximum = 4 ' Progress Bar Maximum
ProgressBar1.Value = 1 ' Set initial Value
While ProgressBar1.Value < ProgressBar1.Maximum
TextBox1.Paste("Starting up")
Waitforabit(5) ' 5 sec wait and update Bar
TextBox1.Clear()
TextBox1.Paste("Copying Labels from Network")
ProcessXCopy() ' XCopy Routine
TextBox1.Clear()
TextBox1.Paste("Waiting 5 Secs")
Waitforabit(5) ' 5 sec wait and update Bar
TextBox1.Clear()
TextBox1.Paste("Setting Background Data")
ProcessBackground()' Set up Background Wallpaper
TextBox1.Clear()
TextBox1.Paste("Waiting 5 Secs")
Waitforabit(5) ' 5 sec wait and update Bar
End While
End Sub
This works if I set it off from a button click on my form, but I don't want a button. As it is, it runs the whole routine, and only displays the form at the final point and 100% full.
Have I missed something obvious?
{My Code Body minus the subroutines that are called}
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ProgressBar1.Minimum = 1 ' Progress Bar Minimum
ProgressBar1.Maximum = 4 ' Progress Bar Maximum
ProgressBar1.Value = 1 ' Set initial Value
While ProgressBar1.Value < ProgressBar1.Maximum
TextBox1.Paste("Starting up")
Waitforabit(5) ' 5 sec wait and update Bar
TextBox1.Clear()
TextBox1.Paste("Copying Labels from Network")
ProcessXCopy() ' XCopy Routine
TextBox1.Clear()
TextBox1.Paste("Waiting 5 Secs")
Waitforabit(5) ' 5 sec wait and update Bar
TextBox1.Clear()
TextBox1.Paste("Setting Background Data")
ProcessBackground()' Set up Background Wallpaper
TextBox1.Clear()
TextBox1.Paste("Waiting 5 Secs")
Waitforabit(5) ' 5 sec wait and update Bar
End While
End Sub
This works if I set it off from a button click on my form, but I don't want a button. As it is, it runs the whole routine, and only displays the form at the final point and 100% full.
Have I missed something obvious?