Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. slash screen

slash screen

Scheduled Pinned Locked Moved Visual Basic
csharptutorialquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lisana
    wrote on last edited by
    #1

    How to create a slash screen in vb.net? I tried to look for so many information of creating slash screen, but most of them are using in vb 6.0 or under. It doesn't work in vb.net. Lisa

    R 1 Reply Last reply
    0
    • L Lisana

      How to create a slash screen in vb.net? I tried to look for so many information of creating slash screen, but most of them are using in vb 6.0 or under. It doesn't work in vb.net. Lisa

      R Offline
      R Offline
      rwestgraham
      wrote on last edited by
      #2

      Lisa, Just create a regular form in VB.NET , typically you would change it's properties so it does not show a title bar or controlbox. Set the form as the startup object and have it call your application initialization code. If the initialization succeeds, have the form launch the main application form and then close itself. Or you can have the main application form initially hidden, then have the main application form show a splash screen. The second approach is a little easier to code in NET. Although I think having a splash screen is still part of the overall presentation of an application, unfortunately much of the point of having a splash screen in the first place is to minimize the user's perception of startup time. This is compromised in NET because the framework itself has to load before you can even show a splash screen and in many cases the framework loading will represent a good percentage or even the majority of your start up time. Robert

      L 1 Reply Last reply
      0
      • R rwestgraham

        Lisa, Just create a regular form in VB.NET , typically you would change it's properties so it does not show a title bar or controlbox. Set the form as the startup object and have it call your application initialization code. If the initialization succeeds, have the form launch the main application form and then close itself. Or you can have the main application form initially hidden, then have the main application form show a splash screen. The second approach is a little easier to code in NET. Although I think having a splash screen is still part of the overall presentation of an application, unfortunately much of the point of having a splash screen in the first place is to minimize the user's perception of startup time. This is compromised in NET because the framework itself has to load before you can even show a splash screen and in many cases the framework loading will represent a good percentage or even the majority of your start up time. Robert

        L Offline
        L Offline
        Lisana
        wrote on last edited by
        #3

        Thanks Robert. How can I code the initializtion succeeds? Private Sub frmSlash_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim main As New frmMain Dim slash As New frmSlash slash.Show() main.Hide() 'if the time > 2 second then ??how to code the condition?? 'I want it to show up the main form after 2 second the slash form load main.show() slash.hide() End Sub Lisa

        V 1 Reply Last reply
        0
        • L Lisana

          Thanks Robert. How can I code the initializtion succeeds? Private Sub frmSlash_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim main As New frmMain Dim slash As New frmSlash slash.Show() main.Hide() 'if the time > 2 second then ??how to code the condition?? 'I want it to show up the main form after 2 second the slash form load main.show() slash.hide() End Sub Lisa

          V Offline
          V Offline
          vertig0730
          wrote on last edited by
          #4

          Create a module and use this code. Make sure you set the module as the startup program Imports System.Threading Module startmod Dim threadsplash As Thread Dim frmsplash As Form Public Sub main() frmsplash = New Splash With frmsplash .Show() .Refresh() End With threadsplash = New Thread(AddressOf hidesplash) threadsplash.Start() Dim Form1 As New Form1 Application.Run(Form1) End Sub Private Sub hidesplash() frmsplash.Opacity = 1 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.9 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.8 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.7 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.6 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.5 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.4 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.3 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Refresh() frmsplash.Close() End Sub End Module James Kennelly

          L 1 Reply Last reply
          0
          • V vertig0730

            Create a module and use this code. Make sure you set the module as the startup program Imports System.Threading Module startmod Dim threadsplash As Thread Dim frmsplash As Form Public Sub main() frmsplash = New Splash With frmsplash .Show() .Refresh() End With threadsplash = New Thread(AddressOf hidesplash) threadsplash.Start() Dim Form1 As New Form1 Application.Run(Form1) End Sub Private Sub hidesplash() frmsplash.Opacity = 1 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.9 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.8 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.7 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.6 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.5 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.4 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Opacity = 0.3 frmsplash.Refresh() threadsplash.Sleep(15) frmsplash.Refresh() frmsplash.Close() End Sub End Module James Kennelly

            L Offline
            L Offline
            Lisana
            wrote on last edited by
            #5

            Thanks! James. Lisa

            R 1 Reply Last reply
            0
            • L Lisana

              Thanks! James. Lisa

              R Offline
              R Offline
              rwestgraham
              wrote on last edited by
              #6

              A little simpler alternative is: Sub Main: Module modMain Public Sub Main() Dim frmMain As New frmMDIMain() Dim frmSplash As New SplashScreen() Dim fStart As Boolean = False 'Show the splash screen frmSplash.Show() 'Run start up code in splash screen fStart = frmSplash.RunInitialization 'Close the splash screen frmSplash.Close() 'If startup was successful launch frmMain If fStart Then Application.Run(frmMain) End If End Sub End Module SplashScreen code ------------------------------------------------------------------------------------------- Public Class SplashScreen Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " ... #End Region Private m_fTimeout As Boolean Public Function RunInitialization() As Boolean 'Enable wait timer Me.tmrWait.Enabled = True Dim fStart As Boolean = False 'Run your main Startup code wrapper function here fStart = RunMyAppStartup() 'Process messages in wait loop until wait timer expires 'Don't care about performance hit of DoEvents for wait timer While Not m_fTimeout Application.DoEvents() End While 'Return value of startup success to Sub Main() Return fStart End Function Private Function RunMyAppStartup() As Boolean 'Your application startup function calls go here 'Just return True for example Return True End Function Private Sub tmrWait_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrWait.Tick Me.tmrWait.Enabled = False 'Set timeout flag to True m_fTimeout = True End Sub Private Sub InitializeControls() Me.lblVersion.Text = "Version: " & CURRENT_VERSION Me.lblTitle.Text = Application.ProductName End Sub End Class

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups