|
-
Oct 13th, 2002, 05:34 PM
#1
Thread Starter
Fanatic Member
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
-
Oct 13th, 2002, 05:35 PM
#2
The picture isn't missing
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  .
-
Oct 13th, 2002, 05:37 PM
#3
Thread Starter
Fanatic Member
-
Oct 13th, 2002, 05:39 PM
#4
Lively Member
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:
Private Sub tmrName_Timer()
frmOtherForm.Show
frmSplashForm.Hide
tmrName.Enabled = False
End Sub
I did something similar to that, but im just a newb, so might not work.
-
Oct 13th, 2002, 05:56 PM
#5
I don't use timers for splash screens. They seem like a waste to me. I do this in the splash form...
VB Code:
Private Sub Form_Activate()
Dim t As Long
t = Timer
While Timer <= t+5 '5 second delay
DoEvents
Wend
Unload Me
End Sub
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Oct 13th, 2002, 06:29 PM
#6
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.
-
Oct 13th, 2002, 06:35 PM
#7
Lively Member
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:
Private Sub Form_Activate()
Dim t As Long
t = Timer
While Timer <= t+5 '5 second delay
DoEvents
Wend
Unload Me
End Sub
Will this work with partial numbers? Instead of 1 second, 2 second, how about 0.5 etc? I may use this...
-
Oct 13th, 2002, 09:59 PM
#8
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|