Solved

VB.Net Splash Screen On Seperate Thread

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

679 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