ToolTip.InitialDelay Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém ou define o tempo que passa antes da ToolTip aparecer.
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
Valor de Propriedade
O período de tempo, em milissegundos, em que o ponteiro deve permanecer parado num controlo antes de a janela ToolTip ser exibida.
Exemplos
O exemplo de código seguinte cria uma instância da ToolTip classe e associa a instância à Form que a instância é criada. O código inicializa então as propriedades AutoPopDelayde atraso , InitialDelay, e ReshowDelay. Além disso, a instância da ToolTip classe define a ShowAlways propriedade para true permitir que o texto ToolTip seja exibido independentemente de o formulário estar ativo ou não. Finalmente, o exemplo associa o texto ToolTip a dois controlos num formulário, a Button e um CheckBox. O exemplo de código exige que o método definido no exemplo esteja localizado dentro de um Form que contenha um Button controlo nomeado button1 e um CheckBox controlo nomeado checkBox1, e que o método seja chamado do construtor do 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
Observações
Com a InitialDelay propriedade, pode encurtar ou prolongar o tempo de ToolTip espera antes de mostrar uma janela de ToolTip. Se o valor da InitialDelay propriedade for definido para um valor demasiado longo, o utilizador da sua aplicação pode não saber que a sua aplicação fornece ToolTip Help. Pode usar esta propriedade para garantir que o utilizador apresenta rapidamente as ToolTips, encurtando o tempo especificado.
O valor desta propriedade não pode exceder 32767.
Se quiser ter um padrão de atraso consistente para as suas janelas ToolTip, pode definir a AutomaticDelay propriedade. A AutomaticDelay propriedade define as AutoPopDelaypropriedades , ReshowDelay, e InitialDelay para valores iniciais baseados num único valor temporal. Sempre que a AutomaticDelay propriedade é definida, a InitialDelay propriedade é definida com o mesmo valor que a AutomaticDelay propriedade. Uma vez definida a AutomaticDelay propriedade, pode defini-la InitialDelay de forma independente, sobrepondo o valor padrão.