Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

WindowsFormsApplicationBase.MinimumSplashScreenDisplayTime Property

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

Namespace:  Microsoft.VisualBasic.ApplicationServices
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
public int MinimumSplashScreenDisplayTime { get; set; }

Property Value

Type: System.Int32
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 Application Page, Project Designer (Visual Basic).

Availability by Project Type

Project type

Available

Windows Forms Application

Yes

Class Library

No

Console Application

No

Windows Forms Control Library

No

Web Control Library

No

Windows Service

No

Web Site

No

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

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 Application Page, Project Designer (Visual Basic).

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.