[VB6] Splash Wait Time

Elite Diviner
Joined
Jan 26, 2006
Messages
483
Reaction score
5
Hey,

I created a nice tool but also a nice splash so I want to see this when I start the application. It now just show for like 1sec but I want to make the wait time longer like 10secs how can I do this cause the most codes at google aint working.
 
Hey,

I created a nice tool but also a nice splash so I want to see this when I start the application. It now just show for like 1sec but I want to make the wait time longer like 10secs how can I do this cause the most codes at google aint working.
Change the timer interval to 10000 - I can't remember exactly - I haven't used VB6 since January.

EDIT:
I remember now. ^^
1000 = 1 sec
10000 = 10secs

Regards,
Hammad
 
Right what you do is..

Create your frmSplash and add a timer called timer1. On the timer button, if you wanna make it last like 5 seconds look for something that looks like it might indicate a time delay and change it to 5000. Now add this code:

Code:
Private Sub timer1_timer
form1.Show
frmSplash.Hide
Unload Me
End Sub
 
well I followed your comment but still no luck I made a screenshot to show you my code:

Darkco - [VB6] Splash Wait Time - RaGEZONE Forums
 
KK After Looking At that picture I See That. I Have A Different Way

Try to look For A Compoent Called like Microsoft Common Controls or Something like That And Look For A Thingy Like A progressBar

And Get The Timer And put it on page (Both of Em)

Code:
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 1
If XP_ProgressBar1.Value = 100 Then
    Timer1.Enabled = False
    frmain.Show
    frmSplashScreen.Hide
    End If
End Sub
End If
 
What Laz-low posted was the best way to do it. Have the timer enabled at startup with an interval of 5000.

Anyways, on another note--Only use the progress bar if you need to. You could use a variable instead, which would save the maker the hastle of including the MSCOMCTL.ocx's (or any variants, such as COMCT32.ocx) with the program itself. With that being said though, progress bars are sexy, even if they are useless sometimes lol. If you need a progress bar and want to save file space, you can use a math equation as well as some VB shapes to do a homebrewed one. Anyways, back to the point. This is yet another alternate way to do it since some reason a normal timer-style splash screen isn't working for ya--

1. Under General Declarations (it's at the very top of the form's code) , put--
Code:
Dim DarkKnightIsHot as integer
2. Make a Timer that is enabled on startup with a time interval of 1000.
3. For the timer's code, put--
Code:
if DarkKnightIsHot = 5 then
frmMain.show
unload me
else
DarkKnightIsHot = DarkKnightIsHot + 1
end if
 
well I tried both of your methods but still no luck..
I dont care really that progress bar if it work it will be fun but when it not work its np I just remove it. I just wanna show that frmSplash screen some longer so people are forced to see it ^^
 
1. Make a timer, with the interval at 10000 (10 secs)
2. In the timer code, put:
Code:
Private Sub timer1_Timer()
frmSplash.Close
Form1.Show
End Sub
3. In the Form_Load section of frmSplash, put:
Code:
Private Sub Form_Load()
Timer1.Enabled = True
End Sub

Should work.

Regards,
Hammad
 
nope isnt working as I said, I searched at google for many solutions none worked for me maybe its just a bug in my vb6...
 
In that case, let's ditch the Timer approach as a whole. Make a module--

Code:
Declare Function GetTickCount Lib "kernel32" () As Long

Sub timeout(Duration As Double)
On Error Resume Next
Dim start As Double
start# = GetTickCount
Do: DoEvents
Loop Until GetTickCount - start# >= (Duration# * 1000)
End Sub

On your splash page put the following on load for your splash page--

Code:
me.show
timeout 5
frmMain.show
unload frmSplash

Btw, if you're using VB without the service packs, I'd recommend getting the service packs for it.
 
Well DarkKnight before I start saying you script is not working I will search for service packs. Cause I just installed vb6 from a old CD I found, I learned much new codes so thanks everyone in this topic for that ... I will guys let you know if it will work
 
Hopefully that'll fix the issues you're having. The situation is pretty weird. The timer methods work, the variable method worked, and the subroutine method for using a timeout works. Hmm. Make a brand new project with a blank Form and Module. Try using the TimeOut method again.

We'll figure this out, damnit! :construct
 
Back