Advertisement
NPSF3000

NPSF3000 Simple VB Splash Screen Example

Jun 30th, 2011
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.96 KB | None | 0 0
  1. ''  VB Splash Screen Loading.
  2.  
  3. ''  All rights NPSF3000
  4. ''  Free for Educational/Personal use, Attribution required.
  5. ''  Provided at end user risk, no responsibility for any damage will be accepted.
  6.  
  7. ''  This is based on a 'hangman' project. It may not be best practice.  Lots of potentially useful stuff has been cut, as this is to help for a school project.
  8.  
  9.     '' On the 'main' form load.
  10.  
  11.     Private Sub Load_Client(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  12.    
  13.  
  14.     '' Make main form invisible, start splash screen.
  15.  
  16.         Me.Visible = False
  17.         Dim splash As New Splash
  18.         Dim startTime As Date = Now()
  19.         splash.Show()
  20.  
  21.        '' Do Stuff
  22.  
  23.  
  24.     '' Finish Displaying Splash Screen.
  25.         Dim time_elapsed As Integer = Now().Millisecond - startTime.Millisecond
  26.         If time_elapsed < 3000 Then Threading.Thread.Sleep(3000 - time_elapsed)
  27.         splash.Close()
  28.         Me.Visible = True
  29.  
  30.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement