C
Chris
I have a form that take a bit to load up because of talking to a database
and the amount of data process that has to take place before showing the
screen. I have it working but I feel that I horked it into working. I was
wondering if there was a better way to do this. Here are the two
interesting pieces of code. Thanks in Advance.
Sub Main
Dim Splash As New SplashScreen
Dim t As System.Threading.Thread
t = New System.Threading.Thread(AddressOf Splash.Process)
Splash.Show()
t.Start()
Dim CF As CommissionForm = New CommissionForm()
Splash.TimeToDie = True
t.Abort()
CF.ShowDialog()
End Sub
'This is Splash Screen code
Public Sub Process()
Do While Not Die
Application.DoEvents()
System.Threading.Thread.CurrentThread.Sleep(125)
Loop
Me.Hide()
Me.Close()
End Sub
and the amount of data process that has to take place before showing the
screen. I have it working but I feel that I horked it into working. I was
wondering if there was a better way to do this. Here are the two
interesting pieces of code. Thanks in Advance.
Sub Main
Dim Splash As New SplashScreen
Dim t As System.Threading.Thread
t = New System.Threading.Thread(AddressOf Splash.Process)
Splash.Show()
t.Start()
Dim CF As CommissionForm = New CommissionForm()
Splash.TimeToDie = True
t.Abort()
CF.ShowDialog()
End Sub
'This is Splash Screen code
Public Sub Process()
Do While Not Die
Application.DoEvents()
System.Threading.Thread.CurrentThread.Sleep(125)
Loop
Me.Hide()
Me.Close()
End Sub