Export (0) Print
Expand All

WindowsFormsApplicationBase.SplashScreen Property

Gets or sets the splash screen for this application.

Namespace:  Microsoft.VisualBasic.ApplicationServices
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public Form SplashScreen { get; set; }

Property Value

Type: System.Windows.Forms.Form
A Form object that the application uses as the splash screen.

ExceptionCondition
ArgumentNullException

The same value is assigned to this property and the MainForm property.

The My.Application.SplashScreen property allows you to get or set the Form object that the application uses as the splash screen, the first graphic form that is displayed while an application is being started.

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

The changes to this property are not persisted when the application closes. To change the splash screen permanently, you must change the setting in the Project Designer.

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 uses the My.Application.SplashScreen property and the My.Application.Startup event to update the splash screen with status information as the application starts.

Private Sub MyApplication_Startup( 
    ByVal sender As Object, 
    ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs 
) Handles Me.Startup
    ' Get the splash screen. 
    Dim splash As SplashScreen1 = CType(My.Application.SplashScreen, SplashScreen1)
    ' Display current status information.
    splash.Status = "Current user: " & My.User.Name
End Sub

This example requires that the project have a splash screen named SplashScreen1. The splash screen needs to have a property named Status that updates its user interface.

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.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.

Show:
© 2014 Microsoft