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

Detecting when VB.net 2005 splash screen closing or closed

P: n/a
Hi All

I have a form set as the splash screen in VB.net 2005 application properties

How can I tell when it has or is closing, as I want to then run some licence
checking code without the splash screen interfering with msgboxes which may
need to be displayed if the licence is invalid or missing

I have tried in the splash form's formclosing event but it does not fire

Regards
Steve
Jul 20 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a

You can use the Load event (which will save time as it will run immediately)
then assign the results to a variable (shared or global etc.) then in the
load event of the main form you can give user the info required

hth,
Samuel

"steve" <ga*****@newsgroups.nospamwrote in message
news:OA**************@TK2MSFTNGP05.phx.gbl...
Hi All

I have a form set as the splash screen in VB.net 2005 application
properties

How can I tell when it has or is closing, as I want to then run some
licence checking code without the splash screen interfering with msgboxes
which may need to be displayed if the licence is invalid or missing

I have tried in the splash form's formclosing event but it does not fire

Regards
Steve

Jul 20 '06 #2

P: n/a
Hi Steve,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know whether a splash
screen has been closed during your program runs. If there is any
misunderstanding, please feel free to let me know.

In my opinion, setting a global flag is the simplest way to achieve this.
It can be a shared(static) variable, and when the splash screen closes,
assign a boolean value to that variable.

If anything is unclear, please feel free to reply to the post.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 21 '06 #3

P: n/a
Hi Kevin

To set the global variable I need to set it in an event which fires when the
splash screen closes

I cannot find an event that fires when it closes

formclosing doesn't fire

Note The splash form is set as the Applications splash screen and I don't
know if this makes a difference

All my other forms in my APP fire the formclosing event when closing

Regards
Steve
"Kevin Yu [MSFT]" <v-****@online.microsoft.comwrote in message
news:Ua****************@TK2MSFTNGXA01.phx.gbl...
Hi Steve,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know whether a splash
screen has been closed during your program runs. If there is any
misunderstanding, please feel free to let me know.

In my opinion, setting a global flag is the simplest way to achieve this.
It can be a shared(static) variable, and when the splash screen closes,
assign a boolean value to that variable.

If anything is unclear, please feel free to reply to the post.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 21 '06 #4

P: n/a
On Fri, 21 Jul 2006 11:30:37 +1000, "steve" <ga*****@newsgroups.nospamwrote:
>Hi Kevin

To set the global variable I need to set it in an event which fires when the
splash screen closes

I cannot find an event that fires when it closes

formclosing doesn't fire

Note The splash form is set as the Applications splash screen and I don't
know if this makes a difference

All my other forms in my APP fire the formclosing event when closing

Regards
Steve

The problem with the Splash Screen that you describe is a known issue. There are a couple of
workarounds that I have found that work depending on what effect you want:

1) Display Splash Screen, check for prerequisits, notify user and exit if prerequisit not met:

Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e _
As Microsoft.VisualBasic.ApplicationServices.StartupE ventArgs) Handles Me.Startup

If NoLicense() Then
'Ensure the Splash Screen has been created and displayed
If Not Me.SplashScreen Is Nothing Then
While Not Me.SplashScreen.IsHandleCreated
System.Threading.Thread.Sleep(100)
End While
'Hide the SplashForm so that the message box can been seen
Me.HideSplashScreen()
End If

MessageBox.Show("License Not Found", "My Application", MessageBoxButtons.OK, _
MessageBoxIcon.Stop)
'Bail out
e.Cancel = True
End If

End Sub

2) Check prerequisits before the Splash Screen is displayed. If prerequisits not met, simply bail
out, else the Splash Form will display and app will continue to load:
Public Sub New() 'in SplashForm

If NoLicense() Then
MessageBox.Show("License Not Found", "My Application", MessageBoxButtons.OK, _
MessageBoxIcon.Stop)
End
End If
'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call.

End Sub
Gene
Jul 21 '06 #5

P: n/a
Hi Steve,

Yes, it's true. I checked internally, like Gene said, it is a known issue.
Gene has provided us with a good workaround. Please let me know if you have
any concern.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 24 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.