Solved

VB.Net Splash Screen On Seperate Thread

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

895 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

17 Experts available now in Live!

Get 1:1 Help Now