how to setup Splash forms


Option Strict On
Imports System.Threading
Imports System.Threading.Thread

Module Module1 'The module statement defines a group of functions, typically a set of DLL entry points.

    Private GreatEstates As frmGreatEstates
    Dim ThreadSplash As Thread
    Dim SplashForm As frmsplash 'SplashForm is the name given to the frmSplash Form


    Public Sub Main()
        SplashForm = New frmsplash

        With SplashForm
            .Show()
            .Cursor = System.Windows.Forms.Cursors.WaitCursor
            .Refresh()
        End With

        ThreadSplash = New Thread(AddressOf HideSplash)
        ThreadSplash.Start()

        Dim Login As New frmMain
        Application.Run(Login) 'Begin Application

    End Sub

    Private Sub HideSplash()
        ThreadSplash.Sleep(5000) 'SplashForm pauses for 2 seconds
        SplashForm.Cursor = System.Windows.Forms.Cursors.Default
        SplashForm.Close()

    End Sub
End Module