Freigeben über


ToolTip.InitialDelay-Eigenschaft

Ruft die bis zum Anzeigen der QuickInfo verstreichende Zeit ab oder legt diese fest.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

Syntax

'Declaration
Public Property InitialDelay As Integer
'Usage
Dim instance As ToolTip
Dim value As Integer

value = instance.InitialDelay

instance.InitialDelay = value
public int InitialDelay { get; set; }
public:
property int InitialDelay {
    int get ();
    void set (int value);
}
/** @property */
public int get_InitialDelay ()

/** @property */
public void set_InitialDelay (int value)
public function get InitialDelay () : int

public function set InitialDelay (value : int)

Eigenschaftenwert

Die Zeitspanne in Millisekunden, in der der Zeiger auf einem Steuerelement nicht bewegt werden darf, bevor das QuickInfo-Fenster angezeigt wird.

Hinweise

Mit der InitialDelay-Eigenschaft können Sie die Zeit verkürzen oder verlängern, bis der ToolTip ein QuickInfo-Fenster anzeigt. Wenn der Wert der InitialDelay-Eigenschaft auf eine zu lange Dauer festgelegt wurde, erkennt der Benutzer der Anwendung möglicherweise nicht, dass die Anwendung QuickInfo-Hilfe bereitstellt. Sie können mit dieser Eigenschaft sicherstellen, dass dem Benutzer QuickInfos schnell angezeigt werden, indem Sie die angegebene Zeit verkürzen.

Der Wert für diese Eigenschaft darf 32767 nicht übersteigen.

Wenn Sie über ein konsistentes Verzögerungsschema für die QuickInfo-Fenster verfügen möchten, können Sie die AutomaticDelay-Eigenschaft festlegen. Die AutomaticDelay-Eigenschaft legt die AutoPopDelay-Eigenschaft, die ReshowDelay-Eigenschaft und die InitialDelay-Eigenschaft auf Anfangswerte fest, die auf einem einzigen Wert beruhen. Jedes Mal, wenn die AutomaticDelay-Eigenschaft festgelegt wird, wird die InitialDelay-Eigenschaft auf den gleichen Wert wie die AutomaticDelay-Eigenschaft festgelegt. Wenn die AutomaticDelay-Eigenschaft festgelegt ist, können Sie für die InitialDelay-Eigenschaft einen anderen Wert festlegen und so den Standardwert überschreiben.

Beispiel

Im folgenden Codebeispiel wird eine Instanz der ToolTip-Klasse erstellt und dem Form zugeordnet, in dem sie erstellt wurde. Der Code initialisiert anschließend die Verzögerungseigenschaften AutoPopDelay, InitialDelay und ReshowDelay. Außerdem legt die Instanz der ToolTip-Klasse die ShowAlways-Eigenschaft auf true fest, damit QuickInfo-Text auch angezeigt werden kann, wenn das Formular nicht aktiv ist. Am Schluss des Beispiels wird der QuickInfo-Text zwei Steuerelementen in einem Formular zugeordnet, einem Button und einer CheckBox. Für dieses Beispiel muss sich die im Beispiel definierte Methode in einem Form befinden, das das Button-Steuerelement button1 und das CheckBox-Steuerelement checkBox1, enthält; außerdem muss die Methode über den Konstruktor von Form aufgerufen werden.

' This example assumes that the Form_Load event handling method
' is connected to the Load event of the form.
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
   ' Create the ToolTip and associate with the Form container.
   Dim toolTip1 As New ToolTip()
   
   ' Set up the delays for the ToolTip.
   toolTip1.AutoPopDelay = 5000
   toolTip1.InitialDelay = 1000
   toolTip1.ReshowDelay = 500
   ' Force the ToolTip text to be displayed whether or not the form is active.
   toolTip1.ShowAlways = True
   
   ' Set up the ToolTip text for the Button and Checkbox.
   toolTip1.SetToolTip(Me.button1, "My button1")
   toolTip1.SetToolTip(Me.checkBox1, "My checkBox1")
End Sub
// This example assumes that the Form_Load event handling method
// is connected to the Load event of the form.
private void Form1_Load(object sender, System.EventArgs e)
{
   // Create the ToolTip and associate with the Form container.
   ToolTip toolTip1 = new ToolTip();

   // Set up the delays for the ToolTip.
   toolTip1.AutoPopDelay = 5000;
   toolTip1.InitialDelay = 1000;
   toolTip1.ReshowDelay = 500;
   // Force the ToolTip text to be displayed whether or not the form is active.
   toolTip1.ShowAlways = true;
      
   // Set up the ToolTip text for the Button and Checkbox.
   toolTip1.SetToolTip(this.button1, "My button1");
   toolTip1.SetToolTip(this.checkBox1, "My checkBox1");
}
// This example assumes that the Form_Load event handling method
// is connected to the Load event of the form.
void Form1_Load( Object^ sender, System::EventArgs^ e )
{
   // Create the ToolTip and associate with the Form container.
   ToolTip^ toolTip1 = gcnew ToolTip;
   
   // Set up the delays for the ToolTip.
   toolTip1->AutoPopDelay = 5000;
   toolTip1->InitialDelay = 1000;
   toolTip1->ReshowDelay = 500;
   // Force the ToolTip text to be displayed whether or not the form is active.
   toolTip1->ShowAlways = true;
   
   // Set up the ToolTip text for the Button and Checkbox.
   toolTip1->SetToolTip( this->button1, "My button1" );
   toolTip1->SetToolTip( this->checkBox1, "My checkBox1" );
}
// This example assumes that the Form_Load event handling method
// is connected to the Load event of the form.
private void Form1_Load(Object sender, System.EventArgs e)
{
    // Create the ToolTip and associate with the Form container.
    ToolTip toolTip1 = new ToolTip();
    // Set up the delays for the ToolTip.
    toolTip1.set_AutoPopDelay(5000);
    toolTip1.set_InitialDelay(1000);
    toolTip1.set_ReshowDelay(500);
    // Force the ToolTip text to be displayed whether or not the form
    // is active.
    toolTip1.set_ShowAlways(true);
    // Set up the ToolTip text for the Button and Checkbox.
    toolTip1.SetToolTip(this.button1, "My button1");
    toolTip1.SetToolTip(this.checkBox1, "My checkBox1");
} //Form1_Load

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

ToolTip-Klasse
ToolTip-Member
System.Windows.Forms-Namespace
ToolTip.AutomaticDelay-Eigenschaft
ToolTip.AutoPopDelay-Eigenschaft
ReshowDelay
UseFading
Popup