|
-
Oct 26th, 2006, 09:28 AM
#1
Thread Starter
Lively Member
[RESOLVED] Splash Screen / Loading Form
Using VB 6.0
OK, I'm a dork... and am having a hard time getting this to work.
Scenario:
Main Form = frmMain
Command Button = cmdOpen
Splash Screen = frmSplash
Form to Open = frmStuff
- I want Open "frmStuff" via "cmdOpen"
- While "frmStuff" is loading... I want "frmSplash" to appear
- When "frmStuff" has loaded, I want "frmSplash" to Unload... and "frmStuff" to Show
Here's how I've tried to code, but things are not working out:
frmMain
Private Sub cmdOpen_Click()
frmSplash.Show frmStuff.Load
frmSplash
*** Here is where I don't know what to code, to recognize that "frmStuff" has finished loading... and to Close/Unload "frmSplash"... and to Show "frmStuff" ***
Any Help / Advice is GREATLY appreciated!!!
-
Oct 26th, 2006, 09:33 AM
#2
Hyperactive Member
Re: Splash Screen / Loading Form
I use Sub Main() to show a splash screen while I'm doing stuff in the background:
VB Code:
Public Sub Main()
' Shows splash screen
frmSplash.Show
frmSplash.Refresh
' Does other things
Call CheckLocalSettings
Load CriteriaSelection
' Takes away splash screen and shows main form
Unload frmSplash
CriteriaSelection.Show
End Sub
-
Oct 26th, 2006, 09:36 AM
#3
Lively Member
Re: Splash Screen / Loading Form
This is to check if the page is complete before continuing.
visual basic code:
Private Sub WB1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If pDisp = WB1 Then
'Page Complete so go to next routine
End If
End Sub
use this code u could add show and hide what ever you want hope this helps this code was posted by lintz.
-
Oct 26th, 2006, 09:44 AM
#4
PowerPoster
Re: Splash Screen / Loading Form
 Originally Posted by eklips
This is to check if the page is complete before continuing.
Check again...this has nothing to do at all with webbrowser. He is talking about forms loading
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Oct 26th, 2006, 09:55 AM
#5
Lively Member
Re: Splash Screen / Loading Form
-
Oct 26th, 2006, 10:02 AM
#6
Thread Starter
Lively Member
Re: Splash Screen / Loading Form
disruptivehair,
What is:
' Does other things
Call CheckLocalSettings
I like your code, just need to clarify what CheckLocalSettings is...
Thanks!!!
-
Oct 26th, 2006, 10:06 AM
#7
Hyperactive Member
Re: Splash Screen / Loading Form
 Originally Posted by balanj
disruptivehair,
What is:
' Does other things
Call CheckLocalSettings
I like your code, just need to clarify what CheckLocalSettings is...
Thanks!!!
balanj, it's not something you have to use; I just copied my own Sub Main() code and stuck it in here. You can just take out "Call CheckLocalSettings" and replace it with whatever code you need to run while your splash screen is being displayed.
But since you're curious, CheckLocalSettings calls a function that checks the registry on the user's machine. It used to do more than just checking the registry but then we went to DSN-less connections. Here's the CheckReg() code called by CheckLocalSettings:
VB Code:
Public Function CheckReg()
Dim strDriver As String
strDriver = ReadRegistry(HKEY_LOCAL_MACHINE, "SOFTWARE\ODBC\ODBCINST.INI\SQL Server", "Driver")
If strDriver = "Not Found" Then
Call WriteRegistry(HKEY_LOCAL_MACHINE, "SOFTWARE\ODBC\ODBCINST.INI\SQL Server", "Driver", 1, "c:\windows\system32\sqlsrv32.dll")
End If
End Function
I should add that I did not actually write CheckReg(); it was written for our team by someone much more capable than I am.
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
|