WindowsFormsApplicationBase.SplashScreen 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會取得或設定這個應用程式的啟動畫面。
public:
property System::Windows::Forms::Form ^ SplashScreen { System::Windows::Forms::Form ^ get(); void set(System::Windows::Forms::Form ^ value); };
public System.Windows.Forms.Form SplashScreen { get; set; }
member this.SplashScreen : System.Windows.Forms.Form with get, set
Public Property SplashScreen As Form
屬性值
應用程式的啟動畫面。
例外狀況
該財產與該 MainForm 財產的價值相同。
範例
此範例使用 屬性 My.Application.SplashScreen 與事件 My.Application.Startup ,在應用程式啟動時更新啟動畫面並顯示狀態資訊。
Private Sub MyApplication_Startup(
sender As Object,
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 更新使用者介面。
您必須在應用程式事件的代碼編輯器視窗中輸入此代碼。 如需詳細資訊,請參閱 應用程式頁面、項目設計工具 (Visual Basic) 。
備註
這個 My.Application.SplashScreen 屬性允許你取得或設定 Form 應用程式用作啟動畫面的物件,啟動畫面是應用程式啟動時顯示的第一個圖形表單。
此特性支援 Visual Basic 應用程式模型。 欲了解更多資訊,請參閱 Visual Basic 應用模型概述。
當應用程式關閉時,對此屬性的變更不會持續存在。 要永久更改啟動畫面,必須在 Project Designer 中更改設定。
依專案類型提供可用性
| 專案類型 | Available |
|---|---|
| Windows 表單應用程式 | Yes |
| 類別庫 | No |
| 主控台應用程式 | No |
| Windows 表單控制函式庫 | No |
| Web 控制庫 | No |
| Windows 服務 | No |
| 網站 | No |