WindowsFormsApplicationBase.MinimumSplashScreenDisplayTime Eigenschaft
Definition
Ruft die minimale Zeitspanne in Millisekunden ab, für die der Begrüßungsbildschirm angezeigt wird, oder legt diese fest.Gets or sets the minimum length of time, in milliseconds, for which the splash screen is displayed.
public:
property int MinimumSplashScreenDisplayTime { int get(); void set(int value); };
public int MinimumSplashScreenDisplayTime { get; set; }
member this.MinimumSplashScreenDisplayTime : int with get, set
Public Property MinimumSplashScreenDisplayTime As Integer
Eigenschaftswert
Die minimale Zeitspanne in Millisekunden, in der der Begrüßungsbildschirm angezeigt wird.The minimum length of time, in milliseconds, for which the splash screen is displayed.
Beispiele
Dieses Beispiel zeigt, wie die- My.Application.MinimumSplashScreenDisplayTime
Eigenschaft durch Überschreiben der-Eigenschaft festgelegt wird OnInitialize .This example demonstrates how to set the My.Application.MinimumSplashScreenDisplayTime
property by overriding the OnInitialize property.
Protected Overrides Function OnInitialize(
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
Für dieses Beispiel ist es erforderlich, dass das Projekt über einen Begrüßungsbildschirm verfügt.This example requires that the project have a splash screen.
Sie müssen diesen Code im Code-Editor-Fenster für Anwendungs Ereignisse eingeben.You must enter this code in the Code Editor window for application events. Weitere Informationen finden Sie unter Application Page, Project Designer (Visual Basic).For more information, see Application Page, Project Designer (Visual Basic).
Hinweise
Mit der- My.Application.MinimumSplashScreenDisplayTime
Eigenschaft können Sie die Mindestzeitdauer angeben, die der Begrüßungsbildschirm der Anwendung angezeigt werden soll.The My.Application.MinimumSplashScreenDisplayTime
property allows you to specify the minimum length of time you want the application's splash screen to be displayed. Wenn das Hauptformular die Initialisierung in kürzerer Zeit als die von dieser Eigenschaft festgelegte Initialisierung abgeschlossen hat, bleibt der Begrüßungsbildschirm so lange erhalten, bis die angeforderte Zeitspanne verstrichen ist. zu diesem Zeitpunkt wird das Hauptformular angezeigt.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. Wenn die Anwendung länger dauert, wird der Begrüßungsbildschirm geschlossen, sobald das Hauptformular aktiv wird.If your application takes longer to start, the splash screen is closed once the main form becomes active.
Wenn Sie der Anwendung mithilfe des Projekt-Designers einen Begrüßungsbildschirm hinzufügen, wird die- My.Application.MinimumSplashScreenDisplayTime
Eigenschaft auf 2000 festgelegt, sodass eine minimale Anzeigezeit von zwei Sekunden angegeben wird.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.
Diese Eigenschaft unterstützt das Visual Basic Anwendungsmodell.This property supports the Visual Basic Application model. Weitere Informationen finden Sie unter Übersicht über das Visual Basic-Anwendungsmodell.For more information, see Overview of the Visual Basic Application Model.
Sie sollten die- My.Application.MinimumSplashScreenDisplayTime
Eigenschaft in einer Methode festlegen, die die-Methode oder die-Methode überschreibt OnInitialize OnCreateSplashScreen .You should set the My.Application.MinimumSplashScreenDisplayTime
property in a method that overrides the OnInitialize or OnCreateSplashScreen method. Code, der Methoden der-Klasse überschreibt WindowsFormsApplicationBase , sollte in der Datei "ApplicationEvents. vb" eingegeben werden, die standardmäßig ausgeblendet ist.Code that overrides methods of the WindowsFormsApplicationBase class should be entered in the ApplicationEvents.vb file, which is hidden by default.
So greifen Sie auf das Fenster "Code-Editor" zuTo access the Code Editor window for overriding members |
1. Wenn Sie ein Projekt in Projektmappen-Explorer ausgewählt haben, klicken Sie im Menü Projekt auf Eigenschaften .1. With a project selected in Solution Explorer, click Properties on the Project menu. 2. Klicken Sie auf die Registerkarte Anwendung .2. Click the Application tab. 3. Klicken Sie auf die Schaltfläche Anwendungs Ereignisse anzeigen , um den Code-Editor zu öffnen.3. Click the View Application Events button to open the Code Editor. Weitere Informationen finden Sie unter Application Page, Project Designer (Visual Basic).For more information, see Application Page, Project Designer (Visual Basic). |
Verfügbarkeit nach ProjekttypAvailability by Project Type
ProjekttypProject type | VerfügbarAvailable |
---|---|
Windows Forms-AnwendungWindows Forms Application | JaYes |
KlassenbibliothekClass Library | NeinNo |
KonsolenanwendungConsole Application | NeinNo |
Windows Forms-SteuerelementbibliothekWindows Forms Control Library | NeinNo |
WebsteuerelementbibliothekWeb Control Library | NeinNo |
Windows-DienstWindows Service | NeinNo |
WebsiteWeb Site | NeinNo |