ToolTip Oluşturucular

Tanım

ToolTip sınıfının yeni bir örneğini başlatır.

Aşırı Yüklemeler

ToolTip()

Belirtilen kapsayıcı olmadan öğesinin ToolTip yeni bir örneğini başlatır.

ToolTip(IContainer)

Belirtilen kapsayıcı ile sınıfının yeni bir örneğini ToolTip başlatır.

ToolTip()

Belirtilen kapsayıcı olmadan öğesinin ToolTip yeni bir örneğini başlatır.

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

Örnekler

Aşağıdaki kod örneği sınıfının bir örneğini ToolTip oluşturur. Kod daha sonra , InitialDelayve ReshowDelaygecikme özelliklerini AutoPopDelaybaşlatır. Ayrıca sınıfı örneği, formun ToolTip etkin olup olmadığına bakılmaksızın ToolTip metninin görüntülenmesini etkinleştirmek için özelliğini true olarak ayarlarShowAlways. Son olarak, örnek ToolTip metnini formdaki iki denetimle ilişkilendirir: a Button ve CheckBox. Kod örneği, örnekte tanımlanan yöntemin adlı bir denetimi ve adlı bir denetimi içeren bir CheckBox checkBox1, içinde Form yer aldığını ve yönteminin Formoluşturucusundan çağrıldığını gerektirir.Button button1

// 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

Açıklamalar

Bu oluşturucu, herhangi bir kapsayıcıyla ilişkilendirilmemiş bir ToolTip örneği oluşturur.

Ayrıca bkz.

Şunlara uygulanır

ToolTip(IContainer)

Belirtilen kapsayıcı ile sınıfının yeni bir örneğini ToolTip başlatır.

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)

Parametreler

cont
IContainer

IContainer kapsayıcısını ToolTiptemsil eden bir .

Açıklamalar

Oluşturucu, ToolTip bir nesnesini herhangi bir ToolTip Container nesneyle ilişkilendirmenizi sağlar. ile bu şekilde ilişkilendirerek ToolTip ToolTip'in kullanım ömrü denetimini öğesine devredebilirsiniz Container. Bu, uygulamanızda birkaç bileşen kullanıyorsanız ve bunların tümünü aynı anda atmak istiyorsanız yararlı olabilir. Örneğin, üzerinde çağrısı Dispose Container yapan bir ToolTip, ImageListve Timer ile Containerilişkilendirirseniz, bu bileşenlerin tümünün atılması da zorlanır.

Ayrıca bkz.

Şunlara uygulanır