ToolTip Konstruktorok
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Inicializálja a ToolTip osztály új példányát.
Túlterhelések
| Name | Description |
|---|---|
| ToolTip() |
Inicializálja a ToolTip megadott tároló nélküli új példányt. |
| ToolTip(IContainer) |
Inicializálja az ToolTip osztály új példányát egy megadott tárolóval. |
ToolTip()
- Forrás:
- ToolTip.cs
- Forrás:
- ToolTip.cs
- Forrás:
- ToolTip.cs
- Forrás:
- ToolTip.cs
- Forrás:
- ToolTip.cs
Inicializálja a ToolTip megadott tároló nélküli új példányt.
public:
ToolTip();
public ToolTip();
Public Sub New ()
Példák
Az alábbi példakód a ToolTip osztály egy példányát hozza létre. A kód ezután inicializálja a késleltetési tulajdonságokat AutoPopDelay, InitialDelayés ReshowDelay. Emellett az osztály példánya úgy állítja be a ToolTipShowAlways tulajdonságot, hogy true engedélyezze az elemleírás szövegének megjelenítését, függetlenül attól, hogy az űrlap aktív-e. Végül a példa az Elemleírás szöveget két vezérlőelemmel társítja egy űrlapon, az a Button és a CheckBox. A példakód megköveteli, hogy a példában definiált metódus egy FormButton elnevezett button1 vezérlőelemet és egy CheckBox elnevezett checkBox1, vezérlőelemet tartalmaz, és hogy a metódus a konstruktortól Formlegyen meghívva.
// 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
Megjegyzések
Ez a konstruktor létrehoz egy olyan elemleírás-példányt, amely nincs tárolóhoz társítva.
Lásd még
A következőre érvényes:
ToolTip(IContainer)
- Forrás:
- ToolTip.cs
- Forrás:
- ToolTip.cs
- Forrás:
- ToolTip.cs
- Forrás:
- ToolTip.cs
- Forrás:
- ToolTip.cs
Inicializálja az ToolTip osztály új példányát egy megadott tárolóval.
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)
Paraméterek
- cont
- IContainer
Az IContainer a tároló, amely a ToolTip.
Megjegyzések
A ToolTip konstruktor segítségével bármilyen ToolTip objektumhoz társíthat egy objektumotContainer. Az ilyen módon történő társítással ToolTip az elemleírás élettartamának vezérlését adod át a Container. Ez akkor lehet hasznos, ha több összetevőt használ az alkalmazásban, és egyszerre szeretné megsemmisíteni az összes összetevőt. Ha például egy ToolTip, egy ImageListés egy Timer elemet társít egyhezContainer, akkor a Dispose hívás Container az összes összetevő eltávolítását is kikényszeríteni fogja.