I am trying to get a Timer to work in my vb.net code.
Here's my current code:
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Timer1.Interval = 1000 '1 second Timer1.Enabled = True Timer1.Start() MsgBox("Why can't this statement get executed after the Timer1 is stopped?") End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick MsgBox("hello from Timer1") End Sub End Class
How can I prevent the msgbox statement (and any statements that follow it) from being executed until the Timer is Stopped?