-
Help with timers
I am trying to load a form from my sub main function but the timer never fires can you tell what am i doing wrong.
Thanks
[CODE]
Public Class MainClass
Friend Shared WithEvents t As New Timer()
Public Shared Sub Main()
Dim cl As New MainClass()
t.Interval = 1
t.Enabled = True
cl.LoadSplash()
End Sub
Public Function LoadSplash()
t.Start()
End Function
Private Shared Sub t_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles t.Tick
MsgBox("Event")
End Sub
End Class
[CODE]
-
You don't have anything halting the executing of the Sub Main so it is reaching the end before the timer ever gets a chance to fire.
-
I think you might be able to use Application.Run(new YourFormHere).