My.Application.SplashScreen 屬性

更新:2007 年 11 月

取得或設定這個應用程式的啟動顯示畫面。

 ' Usage Dim value As System.Windows.Forms.Form = My.Application.SplashScreen ' Declaration Public Property SplashScreen As System.Windows.Forms.Form

傳回值

應用程式用於當做啟動顯示畫面的 Form 物件。

例外狀況

下列條件可能造成例外狀況:

備註

My.Application.SplashScreen 屬性可讓您取得或設定應用程式用於當做啟動顯示畫面的 Form 物件,所謂啟動顯示畫面就是啟動應用程式時第一個顯示的圖形表單。

這個屬性支援 Visual Basic 應用程式模型。如需詳細資訊,請參閱 Visual Basic 應用程式模型概觀

關閉應用程式時,將不會保留這個屬性的變更。若要永久變更啟動顯示畫面,則必須在 [專案設計工具] 中變更設定。如需詳細資訊,請參閱 HOW TO:指定應用程式的開頭顯示畫面 (Visual Basic)

範例

這個範例使用 My.Application.SplashScreen 屬性和 My.Application.Startup 事件,以應用程式啟動時的狀態資訊更新啟動顯示畫面。

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

這個範例要求專案必須有名為 SplashScreen1 的啟動顯示畫面。啟動顯示畫面需要有可更新使用者介面的 Status 屬性。

您必須在應用程式事件的 [程式碼編輯器] 視窗中輸入這個程式碼。如需詳細資訊,請參閱 HOW TO:處理應用程式事件 (Visual Basic)

需求

命名空間Microsoft.VisualBasic.ApplicationServices

類別WindowsFormsApplicationBase

組件:Visual Basic 執行階段程式庫 (在 Microsoft.VisualBasic.dll 中)

依專案類型的可用性

專案類型

是否可用

Windows 應用程式

類別庫

主控台應用程式

Windows 控制項程式庫

Web 控制項程式庫

Windows 服務

網站

使用權限

不需要使用權限。

請參閱

參考

My.Application 物件

My.Application.MinimumSplashScreenDisplayTime 屬性

System.Windows.Forms.Form

WindowsFormsApplicationBase.SplashScreen