Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

when debuging, when program finish window closes how can i stop this

$
0
0
i am new to vb and on quite the learning cure. i am workng on a program with random number generators, multiple timerers, and usb rlay and i/o. everything was going fine untill i got to a point where i needed a random number generator to create a number, wait for a timer to expire, then creat another number. it needed to do this untill a master timer expired. i finally got this to work the way i wanted, but now when the master timer expires, it closes all the forms. it didnt do this be for. here his the script i added. i didnt change anything on any of the timers. i need for the form 1 to stay open.



01 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

02 Timer1.Enabled = True

03 Button2.Enabled = False

04 If Form2.RadioButton5.Checked = True Then random()

05

06 End Sub

07

08 Private Sub random()

09

10 Do

11 Form2.Timer1.Enabled = True

12 Label3.Text = Label3.Text + 1

13

14 Dim rndnumber As Random

15 Dim number As Integer

16 rndnumber = New Random

17 number = rndnumber.Next(1, 4)

18 Form2.Label2.Text = number.ToString

19

20 Do Until Form2.Timer1.Enabled = False

21 If Timer1.Enabled = False Then End

22 Application.DoEvents()

23 Loop

24 Loop

25

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>