Share via


ToolTip.AutoPopDelay Vlastnost

Definice

Získá nebo nastaví dobu Popis zůstane viditelný, pokud je ukazatel na ovládacím prvku se zadaným textem popisu.

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

Hodnota vlastnosti

Doba v milisekundách, po kterou ToolTip zůstává viditelný, když je ukazatel na ovládacím prvku nehybný. Výchozí hodnota je 5000.

Příklady

Následující příklad kódu vytvoří instanci ToolTip třídy a přidruží instanci k Form instanci, ve které je instance vytvořena. Kód pak inicializuje vlastnosti AutoPopDelayzpoždění , InitialDelaya ReshowDelay. Kromě toho instance ToolTip třídy nastaví ShowAlways vlastnost na , true aby bylo možné zobrazit text popisu bez ohledu na to, zda je formulář aktivní. Nakonec tento příklad přidruží text popisu ke dvěma ovládacím prvkům ve formuláři, Button a .CheckBox Příklad kódu vyžaduje, aby metoda definovaná v příkladu byla umístěna v objektu FormButton , který obsahuje ovládací prvek s názvem button1 a CheckBox ovládací prvek s názvem checkBox1, a aby byla metoda volána z konstruktoru objektu 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

Poznámky

Vlastnost AutoPopDelay umožňuje zkrátit nebo prodloužit dobu zobrazení ToolTip okna, když je ukazatel myši na ovládacím prvku. Pokud například v okně popisku zobrazíte rozsáhlou nápovědu, můžete zvýšit hodnotu této vlastnosti, abyste zajistili, že uživatel bude mít dostatek času na přečtení textu.

Pokud chcete mít konzistentní vzor zpoždění pro okna popisů, můžete nastavit AutomaticDelay vlastnost . Vlastnost AutomaticDelay nastaví AutoPopDelayvlastnosti , ReshowDelaya InitialDelay na počáteční hodnoty založené na jedné hodnotě. Při AutomaticDelay každém nastavení AutoPopDelay vlastnosti se vlastnost nastaví na 10násobek AutomaticDelay hodnoty vlastnosti. Jakmile AutomaticDelay je vlastnost nastavena, můžete ji nezávisle nastavit AutoPopDelay a přepíše výchozí hodnotu.

Maximální doba, po kterou můžete zpozdit automaticky otevírané okno, je 5 000 milisekund. U delších dob trvání použijte metodu Show k určení přesného okamžiku, kdy se popis zobrazí.

Platí pro

Viz také