ToolTip.ShowAlways Eigenschaft

Definition

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

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

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

Beispiele

Im folgenden Codebeispiel wird eine Instanz der ToolTip -Klasse erstellt und der Instanz zugeordnet Form , in der 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 auf fest true , damit 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 zu, einem Button und einem CheckBox. Das Codebeispiel erfordert, dass sich die im Beispiel definierte Methode in einem Form befindet, das ein Button Steuerelement namens button1 und ein CheckBox Steuerelement mit dem Namen checkBox1enthält, und dass die -Methode vom -Konstruktor des Formaufgerufen wird.

// 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 ein QuickInfo-Fenster auch dann anzeigen, wenn der Container des ToolTip nicht aktiv ist. Sie können dieses Feature in einer moduslosen Fensteranwendung verwenden, damit QuickInfo-Fenster unabhängig davon angezeigt werden können, welches moduslose Fenster aktiv ist. Dieses Feature ist auch nützlich, wenn Sie ein Steuerelement mithilfe von erstellen möchten, das UserControleine Reihe von Steuerelementen enthält, die QuickInfo-Fenster anzeigen. Da häufig UserControl nicht das aktive Fenster in einem Formular ist, können die Steuerelemente in den UserControl QuickInfo-Fenstern jederzeit angezeigt werden, wenn Sie diese Eigenschaft auf true festlegen.

Gilt für:

Weitere Informationen