Freigeben über


ToolTip.ShowAlways-Eigenschaft

Ruft einen Wert ab, der angibt, ob ein QuickInfo-Fenster auch dann angezeigt wird, wenn das übergeordnete Steuerelement nicht aktiv ist, oder legt diesen fest.

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

Syntax

'Declaration
Public Property ShowAlways As Boolean
'Usage
Dim instance As ToolTip
Dim value As Boolean

value = instance.ShowAlways

instance.ShowAlways = value
public bool ShowAlways { get; set; }
public:
property bool ShowAlways {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_ShowAlways ()

/** @property */
public void set_ShowAlways (boolean value)
public function get ShowAlways () : boolean

public function set ShowAlways (value : boolean)

Eigenschaftenwert

true, wenn die QuickInfo immer angezeigt wird, andernfalls false. Der Standardwert ist false.

Hinweise

Mit der ShowAlways-Eigenschaft können Sie ein QuickInfo-Fenster auch dann anzeigen, wenn der Container des ToolTip nicht aktiv ist. Sie können dieses Feature in einer Anwendung mit nicht modalen Fenstern verwenden, damit QuickInfo-Fenster unabhängig davon angezeigt werden, welches nicht modale Fenster aktiv ist. Dieses Feature ist auch nützlich, wenn Sie ein Steuerelement mit dem UserControl erstellen möchten, das eine Anzahl von Steuerelementen enthält, für die QuickInfo-Fenster angezeigt werden. Da es sich bei UserControl häufig nicht um das aktive Fenster in einem Formular handelt, können die Steuerelemente innerhalb von UserControl jederzeit QuickInfo-Fenster anzeigen, wenn diese Eigenschaft auf true festgelegt wird.

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
UserControl
ToolTip.Active-Eigenschaft
Show