473,405 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Detecting when VB.net 2005 splash screen closing or closed

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
5 6373

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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Joshua Kendall | last post by:
I have a login open a form. Now how do I close the login when the other form opens? Thanks for the help. Joshua Kendall.
14
by: SStory | last post by:
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...
1
by: Ufit | last post by:
How do I detect if my webform was closed and destroyed. Also I have hard time with displaying a new form in a separate window. Can someone help me. Thanks Ufit
3
by: steve | last post by:
Hi All I have a VB.net 2005 App which has a form set as the Application splash screen in Project properties Another form is set as the startup form All works great until the splash screen...
0
by: Riti Pandey | last post by:
Hi, I am using System.Net.Sockets for network programming. I want to detect whether a conncetion is closed by the remote without my involvement ( i.e. my application calling close on socket). A...
1
by: Sanjay | last post by:
i wanna develop a splash screen in my windows application using c#.While splash sreen appears at background application componets should gets loaded as soon as component or dependencies gets...
10
by: =?Utf-8?B?UmljaGFyZCBCeXNvdXRo?= | last post by:
Hi In my app I have a SplashScreen, a login form and a main form. On launching the app, I'd like to show the SplashScreen while reading config files and attempting a database connection. I show...
2
by: Newbie | last post by:
Hi, In the application properties of my vb.net 2008 project I have set one of my forms to be the splash screen. How do I increase the time the splash screen is displayed for. It vanishs to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.