Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie Query VB express

Status
Not open for further replies.

Jips1971

IS-IT--Management
Sep 13, 2007
9
GB
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?
 
I'd use the DoEvents function.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top