Results 1 to 8 of 8

Thread: Need Splash Screen Help NOW!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    Cool Need Splash Screen Help NOW!

    Hey, I need some help really quick here. I personally hate splash screens and think they are stupid, but my VB instructor doesn't think so, so I have to have one. I've got the whole program done, but I don't remember how to do the following:

    I have frmSplash as my startup form. I've got a timer on it called tmrSplash. I enable the timer when the form loads. I want my splash screen to display for 5 secs before loading my main form. What interval and code do I need on my timer control? I've haven't used the timer control in ages! Any help appreciated.

    -Jeremy

  2. #2
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    5000 = 5 seconds

    and in the timer:

    Form2.Show
    Unload me
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    thanks

    n/m

  4. #4
    Lively Member Cagez's Avatar
    Join Date
    Oct 2002
    Posts
    121
    I used a timer just today. To make it show for 5 secs you put the interval to 5000 (5 secs) and then you put in code:

    VB Code:
    1. Private Sub tmrName_Timer()
    2.      frmOtherForm.Show
    3.      frmSplashForm.Hide
    4.     tmrName.Enabled = False
    5. End Sub

    I did something similar to that, but im just a newb, so might not work.

  5. #5
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I don't use timers for splash screens. They seem like a waste to me. I do this in the splash form...
    VB Code:
    1. Private Sub Form_Activate()
    2. Dim t As Long
    3.  
    4.   t = Timer
    5.  
    6.   While Timer <= t+5 '5 second delay
    7.     DoEvents
    8.   Wend
    9.  
    10.   Unload Me
    11.  
    12. End Sub

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  6. #6
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Rather than having your frmSplash as your startup form you might want to consider doing frmSplash.Show vbModal as the first statement in your main form's Load event and unloading frmSplash as the last statment in the Load event. That way your users will see the splash form while your main form is loading (you may still need to add some time code if your main form loads very quickly). BTW, doing it the way I suggest sort of points out why splash screens are a good idea. When a user starts a program it's nice to give them a visual signal (the splash screen) that somethiong is happening.

  7. #7
    Lively Member Cagez's Avatar
    Join Date
    Oct 2002
    Posts
    121
    Originally posted by crptcblade
    I don't use timers for splash screens. They seem like a waste to me. I do this in the splash form...
    VB Code:
    1. Private Sub Form_Activate()
    2. Dim t As Long
    3.  
    4.   t = Timer
    5.  
    6.   While Timer <= t+5 '5 second delay
    7.     DoEvents
    8.   Wend
    9.  
    10.   Unload Me
    11.  
    12. End Sub

    Will this work with partial numbers? Instead of 1 second, 2 second, how about 0.5 etc? I may use this...

  8. #8
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Originally posted by Cagez
    Will this work with partial numbers? Instead of 1 second, 2 second, how about 0.5 etc? I may use this...
    Sure, just replace the (current) + 5 with your number. ie + 0.5

    The Timer function returns a Single representing the number of seconds elapsed since midnight.

    This is an exaple of the resolution: 47159.42

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