ToolTip Konstruktor
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Menginisialisasi instans baru dari kelas ToolTip.
Overload
| Nama | Deskripsi |
|---|---|
| ToolTip() |
Menginisialisasi instans ToolTip baru tanpa kontainer tertentu. |
| ToolTip(IContainer) |
Menginisialisasi instans ToolTip baru kelas dengan kontainer tertentu. |
ToolTip()
- Sumber:
- ToolTip.cs
- Sumber:
- ToolTip.cs
- Sumber:
- ToolTip.cs
- Sumber:
- ToolTip.cs
- Sumber:
- ToolTip.cs
Menginisialisasi instans ToolTip baru tanpa kontainer tertentu.
public:
ToolTip();
public ToolTip();
Public Sub New ()
Contoh
Contoh kode berikut membuat instans ToolTip kelas. Kode kemudian menginisialisasi properti AutoPopDelaypenundaan , , InitialDelaydan ReshowDelay. Selain itu, instans ToolTipShowAlways kelas mengatur properti untuk true mengaktifkan teks TipsAlat yang akan ditampilkan terlepas dari apakah formulir aktif. Terakhir, contoh mengaitkan teks TipsAlat dengan dua kontrol pada formulir, Button dan CheckBox. Contoh kode mengharuskan metode yang ditentukan dalam contoh terletak di dalam Form yang berisi Button kontrol bernama button1 dan CheckBox kontrol bernama checkBox1, dan bahwa metode dipanggil dari konstruktor .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
Keterangan
Konstruktor ini membuat instans ToolTip yang tidak terkait dengan kontainer apa pun.
Lihat juga
Berlaku untuk
ToolTip(IContainer)
- Sumber:
- ToolTip.cs
- Sumber:
- ToolTip.cs
- Sumber:
- ToolTip.cs
- Sumber:
- ToolTip.cs
- Sumber:
- ToolTip.cs
Menginisialisasi instans ToolTip baru kelas dengan kontainer tertentu.
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)
Parameter
- cont
- IContainer
Yang IContainer mewakili kontainer ToolTip.
Keterangan
ToolTip Konstruktor memungkinkan Anda mengaitkan ToolTip dengan objek apa punContainer. Dengan mengaitkan ToolTip dengan cara ini, Anda menyerahkan kontrol masa pakai ToolTip ke Container. Ini dapat berguna jika Anda menggunakan beberapa komponen dalam aplikasi Anda, dan ingin membuang semuanya secara bersamaan. Misalnya, jika Anda mengaitkan ToolTip, , ImageListdan Timer dengan Container, memanggil DisposeContainer juga akan memaksa pembuangan semua komponen ini.