Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual Basic
Objects
 MinimumSplashScreenDisplayTime Prop...
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual Basic Language Reference 
My.Application.MinimumSplashScreenDisplayTime Property 

Determines the minimum length of time, in milliseconds, for which the splash screen is displayed.

' Usage
Dim value As Integer = My.Application.MinimumSplashScreenDisplayTime
' Declaration
Public Property MinimumSplashScreenDisplayTime As Integer

Integer. The minimum length of time, in milliseconds, for which the splash screen is displayed.

The My.Application.MinimumSplashScreenDisplayTime property allows you to specify the minimum length of time you want the application's splash screen to be displayed. If the main form finishes initializing in less time than what is specified by this property, the splash screen remains until the requested amount of time passes, at which time the main form is displayed. If your application takes longer to start, the splash screen is closed once the main form becomes active.

When you add a splash screen to your application using the Project Designer, it sets the My.Application.MinimumSplashScreenDisplayTime property to 2000, giving a minimum display time of two seconds.

This property supports the Visual Basic Application model. For more information, see Overview of the Visual Basic Application Model.

You should set the My.Application.MinimumSplashScreenDisplayTime property in a method that overrides the OnInitialize or OnCreateSplashScreen method. Code that overrides methods of the WindowsFormsApplicationBase class should be entered in the ApplicationEvents.vb file, which is hidden by default.

To access the Code Editor window for overriding members

  1. With a project selected in Solution Explorer, click Properties on the Project menu.

  2. Click the Application tab.

  3. Click the View Application Events button to open the Code Editor.

    For more information, see How to: Handle Application Events (Visual Basic).

This example demonstrates how to set the My.Application.MinimumSplashScreenDisplayTime property by overriding the OnInitialize property.

Visual Basic
Protected Overrides Function OnInitialize( _
    ByVal commandLineArgs As _
    System.Collections.ObjectModel.ReadOnlyCollection(Of String) _
) As Boolean
    ' Set the display time to 5000 milliseconds (5 seconds). 
    Me.MinimumSplashScreenDisplayTime = 5000
    Return MyBase.OnInitialize(commandLineArgs)
End Function

This example requires that the project have a splash screen.

You must enter this code in the Code Editor window for application events. For more information, see How to: Handle Application Events (Visual Basic).

No permissions are required.

Namespace: Microsoft.VisualBasic.ApplicationServices

Class: WindowsFormsApplicationBase

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

Availability by Project Type

Project type Available

Windows Application

Yes

Class Library

No

Console Application

No

Windows Control Library

No

Web Control Library

No

Windows Service

No

Web Site

No

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
WindowState and SplashScreen      dbasnett   |   Edit   |   Show History
Me.WindowState = FormWindowState.Maximized in the form load will cause the form to be displayed behind the splash screen. when i comment on splash screens i always try to remember to tell people to leave the WindowState alone in the load event, and to use the Shown or Activated event if

Me.WindowState = FormWindowState.Maximized

is desired.
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker