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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with splash screen

Status
Not open for further replies.

tg2003

IS-IT--Management
Feb 6, 2003
270
IL
Hi,

I've added a splash screen to my form-based app (vb.net 2008):

Code:
Sub main()             
   SplashScreen1.Show()  ' splash form
.
.
.
Application.Run(Form1) ' the "real" app form
End Sub

I'm starting my app with sub main() because this application works also as a GUI and as a console (non-GUI) application, so I'm not using the "splash screen" property in the project properties page.

I don't know why, but the splash screen is always "cut", and part of it is mixed up with the form that behind of it - please see attached example.

How can I solve it?

Thanks!
 
The way I have utilized splash screens in the past, before .Net had the integrated Splash Screen template was something like the following:

Code:
Dim ss As New MySplashScreen
Dim f1 As New Form1
ss.ShowDialog()
f1.ShowDialog()

There would be code in the splash screen to close itself based on a timer. After closed, the code goes to the ShowDialog for the main form.
 
Thanks, I will try it.

Can't I close the splash screen from the sub main, since I don't know how much time it will take to load the "real" form? The real form depends on the input and network bandwidth, in hence I prefer not to use a timer with a contant interval.

Thanks!
 
What happens during the form load? Are you loading from a database or something to that effect? It may be worth putting some of your loading into a background thread to avoid freezing the GUI.
 
What about throwing an event from form1 when it's ready --- in sub main, subscribe to the event and close the splash screen when it's caught.
 

This is just the BTW question:

I am new to VB.NET (2008) Windows Apps and was trying to start my app from Sub New, but I could not find out how to do it?

Where do you put the Sub New for the Project to give you the choice of selecting it as your Startup Form?

I did try Sub New in a Module, but that did not work :-(


Have fun.

---- Andy
 
RiverGuy - during the form load, I'm connecting to UNIX server and collecting some data. That's the reason it takes a few seconds to load the app. This time is depend on the network bandwidth etc.

How do I use background thread?

Thanks
 
Well, I found how to use the splash to run as a background, without using a separated thread.

I'm using update and refresh methods.

Thank you all!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top