LydaRA
asked on
VB.Net Splash Screen On Seperate Thread
Does anyone have a sample of a VB.Net splash screen launched on a seperate thread? I need it to be interactive while the main app loads a large dataset. My poor attempts don't load until after the main app, and then immediately closes without user action...
Robert
Robert
Hi LydaRA,
Check on this link for some ideas......
https://www.experts-exchange.com/questions/20836799/VB-NET-Creating-a-splash-screen.html
Check on this link for some ideas......
https://www.experts-exchange.com/questions/20836799/VB-NET-Creating-a-splash-screen.html
Typo
Instead of
Dim f As New fmSpalsh()
in the Public Sub thSplashDisplay()
write
Dim f As New fmSplash()
---------
Instead of
Dim f As New fmSpalsh()
in the Public Sub thSplashDisplay()
write
Dim f As New fmSplash()
---------
ASKER
iboutchkine's exmple appears to work in standalone project. It is simpler than what I have been trying. However the splash form does not appear until _after_ the main form in my real project. Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
'add new form fmSplash ( it will be your splash screen)
Imports System.Threading
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
#End Region
Shared thrSplash As Thread
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim clsSplash As New cThreadSplash()
thrSplash = New Thread(New ThreadStart(AddressOf clsSplash.thSplashDisplay)
thrSplash.Start()
End Sub
End Class
Public Class cThreadSplash
Public Sub thSplashDisplay()
Dim f As New fmSpalsh()
f.Text = "Splash Screen"
Try
f.ShowDialog()
Catch es As ThreadAbortException
Thread.ResetAbort()
Catch
End Try
End Sub
End Class