By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

splash screen, VB.NET MDI APP--wierd problem

P: n/a
I am trying to make a splash screen for my vb.net app.
It is an mdi app.

including the splash code produces wierd results.

not inluding makes things fine.

Also have tried loading the splash form from:

* load event of main mdi parent
* sub main in a module
* my own application class
if I load the splash form using splashform.show
and then load MDI main form using showdialog.

show dialog doesn't seem to be (modal/modeless--can't remember term--doesn't
stick around)
it just exits shortly after loading--probably after processing form_load
code--and continues with the line after .showdialog.

Does anyone have any ideas.

Splash form is not real complicated--has a timer to close.

What is the proper way to do a splash screen in VB.NET?

I want it to show first thing but not prohibit loading of main app.

Thanks,

Shane
Nov 20 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
follow-up thought...

my idea of a splash screen isn't to waste load time using .showdialog

but to occupy an impatient user for a few seconds and display needed info
while the real deal is loading.

Shane

"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am trying to make a splash screen for my vb.net app.
It is an mdi app.

including the splash code produces wierd results.

not inluding makes things fine.

Also have tried loading the splash form from:

* load event of main mdi parent
* sub main in a module
* my own application class
if I load the splash form using splashform.show
and then load MDI main form using showdialog.

show dialog doesn't seem to be (modal/modeless--can't remember term--doesn't stick around)
it just exits shortly after loading--probably after processing form_load
code--and continues with the line after .showdialog.

Does anyone have any ideas.

Splash form is not real complicated--has a timer to close.

What is the proper way to do a splash screen in VB.NET?

I want it to show first thing but not prohibit loading of main app.

Thanks,

Shane

Nov 20 '05 #2

P: n/a
Read this:

http://www.codeproject.com/csharp/Pr...asp#xx670031xx

It's C# code but it explains all the concepts you need very well. Pay
particular attention to what it says about threading. This will adress your
"waste time loading using .showdialog" issue.

Erik

"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am trying to make a splash screen for my vb.net app.
It is an mdi app.

including the splash code produces wierd results.

not inluding makes things fine.

Also have tried loading the splash form from:

* load event of main mdi parent
* sub main in a module
* my own application class
if I load the splash form using splashform.show
and then load MDI main form using showdialog.

show dialog doesn't seem to be (modal/modeless--can't remember term--doesn't stick around)
it just exits shortly after loading--probably after processing form_load
code--and continues with the line after .showdialog.

Does anyone have any ideas.

Splash form is not real complicated--has a timer to close.

What is the proper way to do a splash screen in VB.NET?

I want it to show first thing but not prohibit loading of main app.

Thanks,

Shane

Nov 20 '05 #3

P: n/a
"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> schrieb
follow-up thought...

my idea of a splash screen isn't to waste load time using
.showdialog

but to occupy an impatient user for a few seconds and display needed
info while the real deal is loading.

Does this code help?

http://groups.google.com/gr*********...tngp13.phx.gbl
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4

P: n/a
extremely helpful!

didn't implement the whole thing but multithreaded the about.

I find that at least for an MDI app, that in the Debug environment, after
the splash goes away, it minmizes the MDI main window.

doesn't seem to do that in release though.

I will followup if I have more issues.

Thank you,

Shane
"Erik Frey" <er*******@hotmail.com> wrote in message
news:Oz**************@TK2MSFTNGP09.phx.gbl...
Read this:

http://www.codeproject.com/csharp/Pr...asp#xx670031xx
It's C# code but it explains all the concepts you need very well. Pay
particular attention to what it says about threading. This will adress your "waste time loading using .showdialog" issue.

Erik

"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am trying to make a splash screen for my vb.net app.
It is an mdi app.

including the splash code produces wierd results.

not inluding makes things fine.

Also have tried loading the splash form from:

* load event of main mdi parent
* sub main in a module
* my own application class
if I load the splash form using splashform.show
and then load MDI main form using showdialog.

show dialog doesn't seem to be (modal/modeless--can't remember

term--doesn't
stick around)
it just exits shortly after loading--probably after processing form_load
code--and continues with the line after .showdialog.

Does anyone have any ideas.

Splash form is not real complicated--has a timer to close.

What is the proper way to do a splash screen in VB.NET?

I want it to show first thing but not prohibit loading of main app.

Thanks,

Shane


Nov 20 '05 #5

P: n/a
thanks Armin,

I had tried that, but running on a seperate thread seems to work better all
around.

otherwise my main app window, which is called from a mod, finishes--even if
I used

ShowDialog....

Erik's link helped me find a solution--at least I think so... more later if
I have problems.

thanks again,

Shane
"Armin Zingler" <az*******@freenet.de> wrote in message
news:uq**************@tk2msftngp13.phx.gbl...
"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> schrieb
follow-up thought...

my idea of a splash screen isn't to waste load time using
.showdialog

but to occupy an impatient user for a few seconds and display needed
info while the real deal is loading.

Does this code help?

http://groups.google.com/gr*********...tngp13.phx.gbl
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6

P: n/a
Well,

Seems to work except that when the splash form closes it minimizes the main
MDI app form.

Strange behavior.

Shane

"Erik Frey" <er*******@hotmail.com> wrote in message
news:Oz**************@TK2MSFTNGP09.phx.gbl...
Read this:

http://www.codeproject.com/csharp/Pr...asp#xx670031xx
It's C# code but it explains all the concepts you need very well. Pay
particular attention to what it says about threading. This will adress your "waste time loading using .showdialog" issue.

Erik

"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am trying to make a splash screen for my vb.net app.
It is an mdi app.

including the splash code produces wierd results.

not inluding makes things fine.

Also have tried loading the splash form from:

* load event of main mdi parent
* sub main in a module
* my own application class
if I load the splash form using splashform.show
and then load MDI main form using showdialog.

show dialog doesn't seem to be (modal/modeless--can't remember

term--doesn't
stick around)
it just exits shortly after loading--probably after processing form_load
code--and continues with the line after .showdialog.

Does anyone have any ideas.

Splash form is not real complicated--has a timer to close.

What is the proper way to do a splash screen in VB.NET?

I want it to show first thing but not prohibit loading of main app.

Thanks,

Shane


Nov 20 '05 #7

P: n/a
"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Well,

Seems to work except that when the splash form closes it minimizes the main MDI app form.

Strange behavior.

Shane


I've seen this before. If you want to post some of your relevant
startup code I'd be happy to take a look at it.

Erik
Nov 20 '05 #8

P: n/a
had to resort to

SetForegroundWindow api call.

Seems to work though.

Thanks,

Shane
"Erik Frey" <er*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Well,

Seems to work except that when the splash form closes it minimizes the

main
MDI app form.

Strange behavior.

Shane


I've seen this before. If you want to post some of your relevant
startup code I'd be happy to take a look at it.

Erik

Nov 20 '05 #9

P: n/a
Hello,

I thought this splash screen tutorial was great so I tried it out. But one
question is, when the splash screen is up, how can you disable the ability
to close the form using the ALT + F4 key combination??

--
Regards,
Webster
"Erik Frey" <er*******@hotmail.com> wrote in message
news:Oz**************@TK2MSFTNGP09.phx.gbl...
Read this:

http://www.codeproject.com/csharp/Pr...asp#xx670031xx
It's C# code but it explains all the concepts you need very well. Pay
particular attention to what it says about threading. This will adress your "waste time loading using .showdialog" issue.

Erik

"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am trying to make a splash screen for my vb.net app.
It is an mdi app.

including the splash code produces wierd results.

not inluding makes things fine.

Also have tried loading the splash form from:

* load event of main mdi parent
* sub main in a module
* my own application class
if I load the splash form using splashform.show
and then load MDI main form using showdialog.

show dialog doesn't seem to be (modal/modeless--can't remember

term--doesn't
stick around)
it just exits shortly after loading--probably after processing form_load
code--and continues with the line after .showdialog.

Does anyone have any ideas.

Splash form is not real complicated--has a timer to close.

What is the proper way to do a splash screen in VB.NET?

I want it to show first thing but not prohibit loading of main app.

Thanks,

Shane


Nov 20 '05 #10

P: n/a
I'm not sure if you can trap ALT+F4 in the keydown event or not.... Turn on
keypreview on that form and try trapping for ALT+F4 and doing nothing.

If that doesn't work, I don't really know.

Shane
"Webster" <we************@home.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hello,

I thought this splash screen tutorial was great so I tried it out. But one question is, when the splash screen is up, how can you disable the ability
to close the form using the ALT + F4 key combination??

--
Regards,
Webster
"Erik Frey" <er*******@hotmail.com> wrote in message
news:Oz**************@TK2MSFTNGP09.phx.gbl...
Read this:

http://www.codeproject.com/csharp/Pr...asp#xx670031xx

It's C# code but it explains all the concepts you need very well. Pay particular attention to what it says about threading. This will adress

your
"waste time loading using .showdialog" issue.

Erik

"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am trying to make a splash screen for my vb.net app.
It is an mdi app.

including the splash code produces wierd results.

not inluding makes things fine.

Also have tried loading the splash form from:

* load event of main mdi parent
* sub main in a module
* my own application class
if I load the splash form using splashform.show
and then load MDI main form using showdialog.

show dialog doesn't seem to be (modal/modeless--can't remember

term--doesn't
stick around)
it just exits shortly after loading--probably after processing form_load code--and continues with the line after .showdialog.

Does anyone have any ideas.

Splash form is not real complicated--has a timer to close.

What is the proper way to do a splash screen in VB.NET?

I want it to show first thing but not prohibit loading of main app.

Thanks,

Shane



Nov 20 '05 #11

P: n/a
"Webster" <we************@home.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hello,

I thought this splash screen tutorial was great so I tried it out. But one question is, when the splash screen is up, how can you disable the ability
to close the form using the ALT + F4 key combination??

--
Regards,
Webster


Set e.Cancel = true in the Form.Closing event.

Erik
Nov 20 '05 #12

P: n/a
>
Set e.Cancel = true in the Form.Closing event.

Erik


but then how would I close it after all?
--
Regards,
Webster
Nov 20 '05 #13

P: n/a
"Webster" <we************@home.com> wrote in message
news:OX**************@TK2MSFTNGP10.phx.gbl...

Set e.Cancel = true in the Form.Closing event.

Erik


but then how would I close it after all?


There are a number of ways. You could use the Timer control. If you
want the splash screen to sit there for 5 seconds, set the Interval to 5000,
then in the Timer.Tick event, set a private boolean class variable and close
the form:

okToClose = True
Me.Close()

Then modify your Form.Closing event:

If (Not okToClose)
e.Cancel = True
End If

Erik


Nov 20 '05 #14

P: n/a
> There are a number of ways. You could use the Timer control. If you
want the splash screen to sit there for 5 seconds, set the Interval to 5000, then in the Timer.Tick event, set a private boolean class variable and close the form:

okToClose = True
Me.Close()

Then modify your Form.Closing event:

If (Not okToClose)
e.Cancel = True
End If


Cool.. in this way I can use it to trap the Alt-F4 combination like I
wanted...

' for trapping ALT+F4 combination
Dim AltF4 As Boolean

' prevent alt+f4 to close form prematurely
Private Sub SplashScreen_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
If AltF4 Then
e.Cancel = True
End If
End Sub

' trap the alt-f4 combination
Private Sub SplashScreen_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
' check for alt-f4 combination
If e.Modifiers = Keys.Alt And e.KeyCode = Keys.F4 Then
AltF4 = True
End If
End Sub
Thanks a lot!!

--
Regards,
Webster
Nov 20 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.