Splash screen in Visual Studio is a greatway to give user the feedback of loading the application.Problem I faced implementing the Splash Screen is main form always used to hide in the task bar.After doing a couple of searches I found out that spash screen delay time is the culprit.
I made the splash screen to show for few seconds than my main form which gives the focus to the main form that avoids the form staying in the task bar.
In Application Events.vb I added the following
' The following events are availble for MyApplication:
' Startup: Raised when the application starts, before the startup form is created.
' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally.
' UnhandledException: Raised if the application encounters an unhandled exception.
' StartupNextInstance: Raised when launching a single-instance application and the application is already active.
' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
Partial Friend Class MyApplication
Protected Overrides Function OnInitialize(ByVal commandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String)) As Boolean
'Set the splash screen timeout.
Me.MinimumSplashScreenDisplayTime = 1000
'End code paste
In the form load is the following code
Dim dt As DateTime = DateTime.Now
Me.WindowState = FormWindowState.Normal
Dim timespaninms As Integer = (DateTime.Now - dt).Milliseconds
''Comment or delete the line below once you get the average load time after 5 or 6 runs.
'MessageBox.Show("Time in MilliSeconds : " + timespaninms.ToString)
If (timespaninms < My.Application.MinimumSplashScreenDisplayTime) Then
My.Application.MinimumSplashScreenDisplayTime = timespaninms
My.Application.SaveMySettingsOnExit = True
timespaninms = My.Application.MinimumSplashScreenDisplayTime - timespaninms
Thursday, May 8, 2008
IIS Manager Crashes on Start Windows 7, IIS 7.5, Power Shell 5.1. Here is the error I got in the event viewer. IISMANAGER_CRASH IIS Ma...
Update: 1/27/2013 I have got a very good response and feedback for the tool, I am working on the new version of it and soon will be relea...
If you have played with or is using System.DirectoryServices.ActiveDirectory, you might jump into the consclusio that "DirectorySearche...
A small utility written in c# to help get object information in SQL Server Management Studio quickly and easily. It can be used on any versi...