ToolTip.InitialDelay Propriété

Définition

Obtient ou définit le temps écoulé avant l'apparition de l'info-bulle.

public:
 property int InitialDelay { int get(); void set(int value); };
public int InitialDelay { get; set; }
member this.InitialDelay : int with get, set
Public Property InitialDelay As Integer

Valeur de propriété

Int32

Durée, en millisecondes, pendant laquelle le pointeur de la souris doit rester immobile sur un contrôle avant que la fenêtre d'info-bulle s'affiche.

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 true permettre l’affichage du texte Info-bulle, 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 contrôle nommé et un CheckBox contrôle nommé checkBox1, et que la méthode est appelée à partir du constructeur du Form.button1 Button 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 InitialDelay propriété, vous pouvez raccourcir ou allonger le temps d’attente ToolTip avant d’afficher une fenêtre Info-bulle. Si la valeur de la InitialDelay propriété est définie sur une valeur trop longue dans la durée, l’utilisateur de votre application peut ne pas savoir que votre application fournit de l’aide sur les info-bulles. Vous pouvez utiliser cette propriété pour vous assurer que les info-bulles de l’utilisateur s’affichent rapidement en raccourcissant l’heure spécifiée.

La valeur de cette propriété ne peut pas dépasser 32767.

Si vous souhaitez avoir un modèle de retard cohérent pour vos fenêtres Info-bulle, vous pouvez définir la AutomaticDelay propriété. La AutomaticDelay propriété définit les AutoPopDelayvaleurs initiales , ReshowDelayet InitialDelay les propriétés en fonction d’une valeur de temps unique. Chaque fois que la AutomaticDelay propriété est définie, la InitialDelay propriété a la même valeur que la AutomaticDelay propriété. Une fois la AutomaticDelay propriété définie, vous pouvez définir la InitialDelay propriété indépendamment, en remplaçant la valeur par défaut.

S’applique à

Voir aussi