ToolTip Construtores

Definição

Inicializa uma nova instância da classe ToolTip.

Sobrecargas

ToolTip()

Inicializa uma nova instância de ToolTip com um contêiner especificado.

ToolTip(IContainer)

Inicializa uma nova instância da classe ToolTip com um contêiner especificado.

ToolTip()

Inicializa uma nova instância de ToolTip com um contêiner especificado.

public:
 ToolTip();
public ToolTip ();
Public Sub New ()

Exemplos

O exemplo de código a seguir cria uma instância da ToolTip classe. Em seguida, InitialDelayo código inicializa as propriedades AutoPopDelayde atraso e ReshowDelay. Além disso, a instância da ToolTip classe define a propriedade para true permitir que o ShowAlways texto da Dica de Ferramenta seja exibido independentemente de o formulário estar ativo. Por fim, o exemplo associa o texto tooltip a dois controles em um formulário, a Button e um CheckBox. O exemplo de código requer que o método definido no exemplo esteja localizado em um controle nomeado e um CheckBox controle nomeado checkBox1, e que o método seja chamado do construtor do 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

Comentários

Esse construtor cria uma instância de uma Dica de Ferramenta não associada a nenhum contêiner.

Confira também

Aplica-se a

ToolTip(IContainer)

Inicializa uma nova instância da classe ToolTip com um contêiner especificado.

public:
 ToolTip(System::ComponentModel::IContainer ^ cont);
public ToolTip (System.ComponentModel.IContainer cont);
new System.Windows.Forms.ToolTip : System.ComponentModel.IContainer -> System.Windows.Forms.ToolTip
Public Sub New (cont As IContainer)

Parâmetros

cont
IContainer

Um IContainer que representa o contêiner do ToolTip.

Comentários

O ToolTip construtor permite que você associe um ToolTip a qualquer Container objeto. Ao associar ToolTip dessa maneira, você entrega o controle do tempo de vida da Dica de Ferramenta ao Container. Isso pode ser útil se você usar vários componentes em seu aplicativo e quiser descartar todos eles ao mesmo tempo. Por exemplo, se você associar um , um ImageListe um Timer com um Container, chamando Dispose também forçará o Container descarte de todos esses componentes.ToolTip

Confira também

Aplica-se a