ToolTip.ShowAlways Propriété

Définition

Obtient ou définit une valeur indiquant si la fenêtre d'info-bulle apparaît même lorsque son contrôle parent n'est pas actif.

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

Valeur de propriété

Boolean

true si l'info-bulle est toujours visible ; sinon, false. La valeur par défaut est false.

Exemples

L’exemple de code suivant crée une instance de la ToolTip classe et associe l’instance à celle Form dans laquelle l’instance est créée. Le code initialise ensuite les propriétés AutoPopDelayde retard, InitialDelayet ReshowDelay. En outre, l’instance de la ToolTip classe définit la propriété pour true activer l’affichage ShowAlways du texte ToolTip, quel que soit le formulaire actif. Enfin, l’exemple associe du texte Info-bulle à deux contrôles sur un formulaire, un Button et un CheckBox. L’exemple de code nécessite que la méthode définie dans l’exemple se trouve dans un Button Form contrôle nommé et un CheckBox contrôle nommé button1 checkBox1, et que la méthode est appelée à partir du constructeur du 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

Remarques

Avec la ShowAlways propriété, vous pouvez afficher une fenêtre Info-bulle même si le conteneur du ToolTip fichier n’est pas actif. Vous pouvez utiliser cette fonctionnalité dans une application de fenêtre sans mode pour activer l’affichage des fenêtres Info-bulle, quelle que soit la fenêtre active. Cette fonctionnalité est également utile lorsque vous souhaitez créer un contrôle à l’aide UserControldu contrôle , qui contient un certain nombre de contrôles dans celui-ci qui affichent les fenêtres Info-bulle. Étant donné que la UserControl fenêtre active n’est souvent pas sur un formulaire, définissez cette propriété pour true permettre aux contrôles de l’affichage UserControl des fenêtres Info-bulle à tout moment.

S’applique à

Voir aussi