Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading a splash screen first 5

Status
Not open for further replies.

Agent009

Programmer
Apr 4, 2003
96
0
0
IE
I have one form and a splash screen in a visual basic application.I havent added in any code as of yet.

I want to know how to i load the splash screen first(let it stay on the screen for around 5 seconds) and then let the second form(where i'll be doing all my application work) load?

Thanks in advance!

Agent009

 
try:
Declare Sub Sleep Lib "Kernel32" (ByVal milliseconds As Long)

Sleep 5000 'pauses for 5 seconds

then load the second form and unload the first...I think.
Hope this helps.

If you can't beat them, hire someone who can, who wears gloves...
 
1) make start-up object of your project sub Main
(Menu Project/Project properties/general/startUp Object)
2) add a module
3) add in a module:
Code:
Public Declare Sub Sleep Lib "kernel32.dll" (ByVal lTime As Long)

Sub Main()
    frmSplash.Show
    DoEvents
    Sleep 5000  'this makes 5 seconds
    unload frmSplash    
    form1.show  'your main form
end sub
 
Ive added that code into the module in my application. And ive set the splash screen to the form that appears first. But the splash screen never disappears after 5 seconds and form1 never appears!!
 
>>1) make start-up object of your project sub Main

I think you forgot, or misunderstood this step....

Greetings,
Rick
 
As tsh73 says:
<1) make start-up object of your project sub Main
(Menu Project/Project properties/general/startUp Object)>



________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
You can also make the splash screen your startup Object. Then add a timer and set it to 5 seconds (5000). When the timer ends unload the splash screen and move on.

Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top