ToolTip.InitialDelay Egenskap
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Hämtar eller anger den tid som går innan knappbeskrivningen visas.
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
Egenskapsvärde
Den tidsperiod i millisekunder som pekaren måste stå still på en kontroll innan Knappbeskrivningsfönstret visas.
Exempel
I följande kodexempel skapas en instans av ToolTip klassen och instansen associeras med Form den som instansen skapas i. Koden initierar sedan fördröjningsegenskaperna AutoPopDelay, InitialDelayoch ReshowDelay. Dessutom anger ToolTip instansen ShowAlways av klassen egenskapen till true så att Knappbeskrivningstext kan visas oavsett om formuläret är aktivt. Slutligen associerar exemplet ToolTip-text med två kontroller i ett formulär, en Button och en CheckBox. Kodexemplet kräver att metoden som definieras i exemplet finns i en Form som innehåller en Button kontroll med namnet button1 och en CheckBox kontroll med namnet checkBox1, och att metoden anropas från konstruktorn i 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
Kommentarer
Med egenskapen InitialDelay kan du förkorta eller förlänga den tid som ToolTip väntar innan du visar ett Knappbeskrivningsfönster. Om värdet för InitialDelay egenskapen är inställt på ett värde som är för långt vet kanske inte programmets användare att programmet tillhandahåller hjälp med knappbeskrivning. Du kan använda den här egenskapen för att se till att användaren har knappbeskrivningar som visas snabbt genom att förkorta den angivna tiden.
Värdet för den här egenskapen får inte överstiga 32767.
Om du vill ha ett konsekvent fördröjningsmönster för knappbeskrivningsfönstren kan du ange egenskapen AutomaticDelay . Egenskapen AutomaticDelay anger AutoPopDelayegenskaperna , ReshowDelayoch InitialDelay till initiala värden baserat på ett enda tidsvärde. Varje gång egenskapen AutomaticDelay anges InitialDelay anges egenskapen till samma värde som egenskapen AutomaticDelay . När egenskapen AutomaticDelay har angetts kan du oberoende ange InitialDelay egenskapen och åsidosätta standardvärdet.