Most First Form

callraheel

Well-known member
Joined
Dec 12, 2004
Messages
65
Location
London,UK
Programming Experience
1-3
Hello
In my application i need to display an introduction form like displayed in all applications..
Im using the following code to do that :
This code is from my main application form's load event
PrivateSub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load

Me.Hide()

' Now display the introduction form for this application

Dim objDisplay AsNew frmDisplay

objDisplay.Show()

objDisplay.ResumeLayout()

Dim curThread As Thread = Thread.CurrentThread

curThread.Sleep(5000)

objDisplay.Dispose()

objDisplay =
Nothing

Me.Show()

Status = "Ready"

EndSub


Everything is going fine except the display form is not displayed properly and its controls which contains two labels and one picture are vanished from form and after 5 seconds the main application is displayed..
So i need to know why its happening and how to display the introduction page properly.

See the attachment for further clarity

Regards

 

Attachments

  • err_form_cut.JPG
    err_form_cut.JPG
    34.9 KB · Views: 83
Last edited:
Nope........ its not a splash screen........its just an introduction page containing two labels which have text in it and a picture box which has a static image.....nothing else!
So whats the problem with it????
Waiting for response.
Regards
 
kulrom said:
With one word: Are you trying to make a splash screen?

Cheers ;)

callraheel said:
Nope........ its not a splash screen........its just an introduction page containing two labels which have text in it and a picture box which has a static image.....nothing else!
So whats the problem with it????
Waiting for response.
Regards

to simply it, he's making a splash screen

those introduction windows that applications (like MS Word, MS Excel, Paint Shop Pro, Nero 4, 5, & 6) are splash screens

here's an example (it's in c# but c# is easy to convert to vb.net)
http://www.codeproject.com/netcf/casoast.asp

basically you have the splash screen form, the main form and a module in the project

you build the main form the way you want it and what not
also you make the splash screen the way you want it, but keep in mind you'll need it to exit easily somehow most have the user click anywhere and it'll close also you can put a timer on it for 10 seconds or whatever and have it close through that

any who you use the module to act as the startup object to bring it all together (splash screen followed by the main form) so click on Project - > (project name) Properties -> Sub Main (it's in the startup object dropdown) -> Ok

ok now in the module:
VB.NET:
Option Explicit On
Option Strict On
Module Module1
  Friend frmMain As New frmMain  '(or Form1 if it wasnt ever renamed)
  Friend frmSplash As New frmSplashScreen
  Public Sub Main()
	Application.Run(frmSplash)
	Application.Run(frmMain)
  End Sub
End Module

what this does is declares the two forms and runs the splash screen first (until it gets closed) then it runs the main form until that's closed once the main form is closed the whole application exit's and all resources are released
 
Last edited:
Back
Top