Splash Window question

vnarod

Regular
Joined
Mar 22, 2002
Messages
84
I click on a report name and report starts loading. I need to display a splash window that says "Loading Report". The problem is that it all happens within MDI form. If I make splash window a child then it is not positioned correctly and appears maximized if other forms are maximized. If I don't make it a child, then I have to use ShowDialog and that blocks the execution. What is the proper way to do it?
 
Create a normal form for your splash form and add a timer to it for however long you want it to stay visible for. When the timer is up close the form
 
I'd hate to use a timer since the timer may not be long enough or may be too long.

You can show a form that's not a child and not make it modal. You'll want to set some properties on your splash form, though, to keep it on top so that it doesn't get hidden. Just playing around, I tried the following settings for the splash form and they worked quite well:
ControlBox = false
FormBorderStyle = FixedToolWindow
TopMost = true
Caption = - well, no caption - just clear the text

When you want to show the form, just create a new instance and call .Show(). You can often do this in the constructor of a large form that you're loading and then close the splash form when the main form (or report form) is activated.

-Nerseus
 
I weird thing is happening.

Dim fmLoading As New frmLoading()
fmLoading.Show()

I am getting an "Object reference not set to an instance of af an object" error on .Show line. If I change it to ShowDialog - no error. Any thoughts?
 
There is no code in the form at all - it is just a splash window. Besides, why would ShowDIalog work and Show not?
 
The show dialog stops further processing until the showdialog is dismissed. Something in your code is erroring beyond the show statement. Probably trying to access the object after it has been closed. Try commenting out the code that closes the splash and see if it errors.

Jon
 
Back
Top