Freigeben über


ToolTip.ShowAlways Eigenschaft

Definition

Dient zum Abrufen oder Festlegen eines Werts, der angibt, ob ein QuickInfo-Fenster angezeigt wird, auch wenn das übergeordnete Steuerelement nicht aktiv ist.

public:
 property bool ShowAlways { bool get(); void set(bool value); };
public bool ShowAlways { get; set; }
member this.ShowAlways : bool with get, set
Public Property ShowAlways As Boolean

Eigenschaftswert

truewenn die QuickInfo immer angezeigt wird; andernfalls . false Der Standardwert lautet false.

Beispiele

Im folgenden Codebeispiel wird eine Instanz der ToolTip Klasse erstellt und der Instanz zugeordnet, in der Form die Instanz erstellt wird. Der Code initialisiert dann die Verzögerungseigenschaften AutoPopDelay, InitialDelayund ReshowDelay. Darüber hinaus legt die Instanz der ToolTip Klasse die ShowAlways Eigenschaft so fest, dass true QuickInfo-Text unabhängig davon angezeigt werden kann, ob das Formular aktiv ist. Schließlich ordnet das Beispiel QuickInfo-Text zwei Steuerelementen in einem Formular, einem Button und einem Steuerelement CheckBoxzu. Das Codebeispiel erfordert, dass sich die im Beispiel definierte Methode in einem Form Steuerelement befindet, das ein Button Steuerelement namens button1 und ein CheckBox Steuerelement mit dem Namen checkBox1enthält, und dass die Methode vom Konstruktor der .Form

// 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.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 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

Hinweise

Mit der ShowAlways Eigenschaft können Sie auch dann ein QuickInfo-Fenster anzeigen, wenn der Container des ToolTip Steuerelements nicht aktiv ist. Sie können dieses Feature in einer moduslosen Fensteranwendung verwenden, um die Anzeige von QuickInfo-Fenstern unabhängig davon zu ermöglichen, welches moduslose Fenster aktiv ist. Dieses Feature ist auch hilfreich, wenn Sie ein Steuerelement mithilfe des UserControlSteuerelements erstellen möchten, das eine Reihe von Steuerelementen enthält, in denen QuickInfo-Fenster angezeigt werden. Da es sich UserControl häufig nicht um das aktive Fenster eines Formulars handelt, können Sie durch Festlegen dieser Eigenschaft true die Steuerelemente in den UserControl QuickInfo-Fenstern jederzeit anzeigen.

Gilt für:

Weitere Informationen