Solved

VB.Net Splash Screen On Seperate Thread

Posted on 2004-04-08
7
545 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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