Same Progress bar show in 2 forms - VIsual basic 2008

JD2369

Member
Joined
Jan 12, 2011
Messages
19
Programming Experience
Beginner
I have 1 form with the progress bar and 4 buttons with the following code. I would like to create another form that shows the same progress bar with the same progress. Please help

Here's my code for progress bar

form load code is:

ProgressBar1.Minimum = 0
ProgressBar1.Maximum = 100
ProgressBar1.Value = 0



each button has the following code:


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ProgressBar1.Value < 100 Then

ProgressBar1.Value += 5

End If



Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

If ProgressBar1.Value < 100 Then

ProgressBar1.Value += 20

End If


etc etc

how do i get that progress bar to be show in another form?

If form2.ProgressBar1.Value < 100 Then

ProgressBar1.Value += 20

End If

????????????????????

Thanks
 
You don't show the same control in two different places. There's no need to though. Just show two different ProgressBars with the same Value. There's no reason that you can't set the Value of two ProgressBars at the same time.
 
Back
Top