Solved

VB.Net Splash Screen On Seperate Thread

Posted on 2004-04-08
7
548 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:LydaRA
  • 3
7 Comments
 
LVL 28

Expert Comment

by:iboutchkine
ID: 10785366
try this

'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


   
0
 
LVL 27

Expert Comment

by:planocz
ID: 10785368
0
 
LVL 28

Expert Comment

by:iboutchkine
ID: 10785431
Typo

Instead of

 Dim f As New fmSpalsh()
in the Public Sub thSplashDisplay()

write

 Dim f As New fmSplash()
                         ---------
0
 

Author Comment

by:LydaRA
ID: 10785650
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?
0
 
LVL 28

Accepted Solution

by:
iboutchkine earned 500 total points
ID: 10786012
Hide Form1 when the thread starts and show after it finishes
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now