Results 1 to 9 of 9

Thread: switching forms

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2004
    Posts
    73

    switching forms

    I have a main form that I was using. Now I created a Splash screen to jazz up my program. How to get my splash screen to load up first?
    Last edited by pea33nut; Jun 17th, 2004 at 01:20 PM.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jun 2004
    Posts
    73
    Anyone??

  3. #3
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Project->Properties->Startup Object

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2004
    Posts
    73
    How do I set this up so my Main form displays after my splash screens timer expires?

    Private Sub tmrAsiSplash_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrAsiSplash.Tick

    Me.Close()

    End Sub

    Private Sub frmAsiSplash_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim Main As New frmMain
    Main.Show()

    End Sub

  5. #5
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    VB Code:
    1. Private Sub tmrAsiSplash_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrAsiSplash.Tick
    2.  
    3. Dim Main As New frmMain
    4. Main.Show()
    5. Me.Close()
    6.  
    7. End Sub
    8.  
    9. Private Sub frmAsiSplash_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    10.  
    11.  
    12.  
    13. End Sub

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jun 2004
    Posts
    73
    It Just shuts the application down?

  7. #7
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Create a new module and add a Sub Main in there. Change your startup object to Sub Main.

    In sub main just have:

    VB Code:
    1. Sub Main()
    2. dim f as new frmAsiSplash
    3. f.ShowDialog()
    4. dim fMain as new frmMain
    5. fMain.showDialog()
    6.  
    7. End sub

    Then in frmAsiSplash, just have this:

    VB Code:
    1. Private Sub tmrAsiSplash_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrAsiSplash.Tick
    2.  
    3. Dim Main As New frmMain
    4. Main.Show()
    5. Me.Close()
    6.  
    7. End Sub

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jun 2004
    Posts
    73
    That worked but I was in some type of loop. my main form kept popping up ever few seconds.

  9. #9
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Take the form main stuff out of the Tick event.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width