I'm making a desktop GUI with VB. When I click button1 on Window1, it opens up a new window. I have window 1 window 2 and window 3. On window 2, when a progress bar gets to 100% it opens up window 3. But when the window3 opens I dont need window 2 open anymore. So I close out Window 2 but it just comes back up. Any ideas?
Window1(Members.class)
Code:
PublicClass Members
PrivateSub ToolStripStatusLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
EndSub
PrivateSub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Start()
ProgressBar1.Increment(1)
If ProgressBar1.Value = 100 Then
Members2.Show()
EndIf
EndSub
PrivateSub ProgressBar1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgressBar1.Click
ProgressBar1.Value = 100
EndSub
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
EndSub
PrivateSub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
EndSub
PrivateSub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
RichTextBox1.HideSelection = False
Dim i AsDouble
For i = 0 To RichTextBox1.Text.Length Step 5 ' change this to adjust the speed of the scroll. The higher the number the faster the scroll.
RichTextBox1.SelectionStart = i 'RichTextBox1.Text.Length
Next
EndSub
EndClass
Window 2(Members2.class)
Code:
PublicClass Members2
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Members3.ShowDialog()
EndSub
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
EndSub
EndClass
Window3(Members3.class)
Code:
PublicClass Members3
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
Members2.Close()
Member1.Close()
EndSub
EndClass
But Members2 wont close.
It closes for a second and then it comes right back up.
How do I fix this?
Also, if you saw my richtextbox autoscroll in Members1, that doesnt work either. Any idea why that isnt working?
EDIT:
When I add a stop to Timer1 in Members.class the problem stops.
But when I stop the timer the progress bar wont increase so the new window wont open.