Shandy's Blog

Where Andrew Sutton, aka Shandy rants and rambles on as the fancy takes him

This blog hosted by:
http://blogs.vbcity.com      
  Home :: Syndication  :: Login

My name is Andrew Sutton, aka Shandy.

I am currently living and working in the UK within the garment industry as an IT specialist. This blog contains mainly IT related issues.

I was a Microsoft VB MVP for a couple of years (Apr 2004-Mar 2006) and was a vbCityLeader between April 2003 and June 2007.

If you are looking for my Sri Lanka or Morocco experiences check out Shandy's Sri Lanka Blog or Shandy's Morocco Blog. My personal (Non IT) blog is now at Shandy's Place

OctNovember 2008Dec
SMTWTFS
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

Articles

Archives

Topics

Image Galleries

.NET

Blogs I Read

Others

VB.Classic

VB.NET 2005 provides "native" functionality to display a splash screen on application startup. To add a splash screen to a project the follow the steps outlined below:
  • Add a splash screen form.
  • Make the application display the splash screen on start up.
  • Customise the splash screen display time.
  • Customise the splash screen.

Add A Splash Screen Form

You can either add a default splash screen template form provided with VB.NET 2005 by selecting the menu options Project, Add Windows Form and selecting the Splash Screen icon from the dialog box displayed or simply add your own default windows form by selecting the menu options Project, Add Windows Form and selecting the Windows Form icon from the dialog box displayed. Either form can be customised as required. The advantage of using the splash screen template is that the form is already set up with a background image and label controls, populated in the SplashScreen1_Load event, and is automatically named SplashScreen1.vb. The default splash screen is displayed below.

Make the Application Display the Splash Screen on Start Up

From the Solution Explorer open My Project, select the Application tab and then from the Splash screen: drop down select the Splash Screen you have added to your project (by default SplashScreen1) At this point you can run your project and a splash screen will be displayed for a minimum of 2 seconds before your main project form is displayed.

Customise the Splash Screen Display Time

From the Solution Explorer open My Project, select the Application tab and then activate the View Application Events button. This will load the ApplicationEvents module, which is initially hidden. You then need to add the following code into the MyApplication class, varying the 5000 (5 seconds) literal as required.

Code CopyHideScrollFull
Protected Overrides Function OnInitialize( _
ByVal commandLineArgs As _
System.Collections.ObjectModel.ReadOnlyCollection(Of String) _
) As Boolean
Me.MinimumSplashScreenDisplayTime = 5000
Return
MyBase.OnInitialize(commandLineArgs)
End Function
. . .

Customise The Splash Screen

This is a matter of personal taste. I have included a screenshot of the one I created for work:

This was created from scratch rather than by using the splash screen template. I made our company's logo a background image for a table layout panel and included 5 label controls for Application Name, Version, Company Name, Copyright and a warning message. I also included two status strip controls so that messages can be sent and displayed on the splash screen.
posted on Thursday, April 12, 2007 4:32 PM

Feedback

# Creating A Splash Screen In VB.NET 2005 Article Posted 4/13/2007 1:34 AM Shandy's Blog


# re: Creating A Splash Screen In VB.NET 2005 1/8/2008 9:18 PM Jacob
Thank god for you because it was taking me days and hours to figure out how to properly configure the splash screen. And at the same time you helped figure out another issue!

# re: Creating A Splash Screen In VB.NET 2005 2/8/2008 7:12 PM MR.VK
Thanks.. was under pressure for time, very helpfull and straight to the point.

# re: Creating A Splash Screen In VB.NET 2005 3/17/2008 6:16 AM Chief
I've added some code to show a status label(like verifying a database connection) in my splash screen showing an error messagebox when a task fails but the problem is that the error message pops up behind the splash screen so how can i fix this?

# re: Creating A Splash Screen In VB.NET 2005 4/23/2008 7:46 AM kokopelli
i find this an easy way to implement the most essential feature for a project

# re: Creating A Splash Screen In VB.NET 2005 5/18/2008 9:12 AM hello
when d code is paste there errors r occuring...

can any1 tell me the reason behind it..
& tell me d procedure after clicking on the "View Application Events button"....

Post Feedback

Title:
Name:
Url:
Comments: 
Protected by Clearscreen.SharpHIPEnter the code you see: