Partager via


ToolTip.ShowAlways Propriété

Définition

Obtient ou définit une valeur indiquant si une fenêtre Info-bulle est affichée, même si 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é

true si l’info-bulle est toujours affichée ; 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 délai, InitialDelayet ReshowDelay. En outre, l’instance de la ToolTip classe définit la ShowAlways propriété pour permettre au true texte Info-bulle d’être affiché, que le formulaire soit actif ou non. 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 Form contrôle qui contient un Button contrôle nommé button1 et un CheckBox contrôle nommé 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 lorsque le conteneur du fichier ToolTip 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 du UserControlcontrô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 active sur un formulaire, définissez cette propriété pour permettre aux true contrôles dans la UserControl fenêtre d’info-bulle d’afficher les fenêtres info-bulle à tout moment.

S’applique à

Voir aussi