ToolTip Konstruktory
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Inicializuje novou instanci ToolTip třídy.
Přetížení
| Name | Description |
|---|---|
| ToolTip() |
Inicializuje novou instanci ToolTip bez zadaného kontejneru. |
| ToolTip(IContainer) |
Inicializuje novou instanci ToolTip třídy se zadaným kontejnerem. |
ToolTip()
- Zdroj:
- ToolTip.cs
- Zdroj:
- ToolTip.cs
- Zdroj:
- ToolTip.cs
- Zdroj:
- ToolTip.cs
- Zdroj:
- ToolTip.cs
Inicializuje novou instanci ToolTip bez zadaného kontejneru.
public:
ToolTip();
public ToolTip();
Public Sub New ()
Příklady
Následující příklad kódu vytvoří instanci ToolTip třídy. Kód pak inicializuje vlastnosti AutoPopDelayzpoždění , InitialDelaya ReshowDelay. Kromě instance ToolTip třídy nastaví ShowAlways vlastnost povolit true toolTip text zobrazit bez ohledu na to, zda formulář je aktivní. A konečně příklad přidruží text popisu k dvěma ovládacím prvkům ve formuláři a Button a CheckBox. Příklad kódu vyžaduje, aby metoda definovaná v příkladu byla umístěna uvnitř Form , který obsahuje Button ovládací prvek pojmenovaný button1 a ovládací prvek pojmenovaný CheckBoxcheckBox1, a že metoda je volána z konstruktoru 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
Poznámky
Tento konstruktor vytvoří instanci popisku, která není přidružena k žádnému kontejneru.
Viz také
Platí pro
ToolTip(IContainer)
- Zdroj:
- ToolTip.cs
- Zdroj:
- ToolTip.cs
- Zdroj:
- ToolTip.cs
- Zdroj:
- ToolTip.cs
- Zdroj:
- ToolTip.cs
Inicializuje novou instanci ToolTip třídy se zadaným kontejnerem.
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)
Parametry
- cont
- IContainer
Představuje IContainer kontejner objektu ToolTip.
Poznámky
Konstruktor ToolTip umožňuje přidružit k libovolnému Container objektuToolTip. Tím, že tímto způsobem přidružujete ToolTip kontrolu nad životností Popis tlačítka Container. To může být užitečné, pokud ve své aplikaci používáte několik komponent a chcete je odstranit ve stejnou dobu. Pokud například přidružíte ToolTipk volání , , ImageLista k TimerContainer, zavolání DisposeContainer bude také vynutit odstranění všech těchto součástí.