|
-
Nov 15th, 2003, 10:05 PM
#1
Thread Starter
Lively Member
Forms control via Startup Class.
Ok, I have a splash and a class. as default, it displays the splash before doing anything else. then after it has completed its tasks in Sub Main, I want it to close the splash and open the main form. But the splash form doesn't close!!! what do I do??
DannyJoumaa
Advanced VB6 Programmer
Intermediate-Advanced VB .NET Programmer
Intermediate C# Programmer
Intermediate Win32 Developer
Beginner Mac OS X Developer
Contact: [email protected]
Favorite Sayings:
"Every time you open your mouth, you prove your an idiot."
"God is a programmer. Satan is a bug. Life is debugging."
-
Nov 16th, 2003, 02:03 AM
#2
PowerPoster
Start by posting your Main sub so we can not 'shoot from the hip' to solve your problem.
-
Nov 16th, 2003, 10:48 AM
#3
Thread Starter
Lively Member
VB Code:
Shared Sub main()
Try
Application.EnableVisualStyles()
Dim msg As New frmMSG
Dim splash As New frmSplash
Dim s As New StartUp
Application.Run(splash)
' Do some loading code
splash.Close()
Dim main As New frmMain
Application.Run(main)
Catch
MsgBox("An error has occured. Program may continue to run, but saftey measures presist to close this application." & vbLf & vbLf & "Click OK to terminate the application.", MsgBoxStyle.Critical + MsgBoxStyle.OKOnly, "Error " & CType(Err.Number, String))
Debug.Write("Error " & CType(Err.Number, String) & " occured." & vbLf & "Error Information: " & Err.Description & " " & Err.Source)
End
End Try
End Sub
DannyJoumaa
Advanced VB6 Programmer
Intermediate-Advanced VB .NET Programmer
Intermediate C# Programmer
Intermediate Win32 Developer
Beginner Mac OS X Developer
Contact: [email protected]
Favorite Sayings:
"Every time you open your mouth, you prove your an idiot."
"God is a programmer. Satan is a bug. Life is debugging."
-
Nov 16th, 2003, 12:00 PM
#4
PowerPoster
Code:
Shared Sub main()
Try
Application.EnableVisualStyles()
Dim msg As New frmMSG
Dim splash As New frmSplash
Dim s As New StartUp
splash.Show()
' Do some loading code
splash.Close()
Dim main As New frmMain
Application.Run(main)
'or
'main.ShowDialog()
Catch
MsgBox("An error has occured. Program may continue to run, but saftey measures presist to close this application." & vbLf & vbLf & "Click OK to terminate the application.", MsgBoxStyle.Critical + MsgBoxStyle.OKOnly, "Error " & CType(Err.Number, String))
Debug.Write("Error " & CType(Err.Number, String) & " occured." & vbLf & "Error Information: " & Err.Description & " " & Err.Source)
End
End Try
End Sub
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
|