ToolTip.ShowAlways Tulajdonság
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.
Lekéri vagy beállít egy értéket, amely jelzi, hogy megjelenik-e egy Elemleírás ablak, még akkor is, ha a szülő vezérlőelem nem aktív.
public:
property bool ShowAlways { bool get(); void set(bool value); };
public bool ShowAlways { get; set; }
member this.ShowAlways : bool with get, set
Public Property ShowAlways As Boolean
Tulajdonság értéke
trueha az elemleírás mindig megjelenik; egyéb esetben. false Az alapértelmezett érték a false.
Példák
Az alábbi példakód létrehozza az ToolTip osztály egy példányát, és társítja a példányt azzal, Form amelyikben a példány létrejön. 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 Form elnevezett és egy Buttonbutton1 elnevezett CheckBoxcheckBox1vezé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
ShowAlways A tulajdonsággal akkor is megjelenítheti az Elemleírás ablakot, ha a ToolTip tároló nem aktív. Ezt a funkciót egy mód nélküli ablakalkalmazásban is használhatja az Eszközleírás ablak megjelenítésének engedélyezéséhez, függetlenül attól, hogy melyik üzemmód nélküli ablak aktív. Ez a funkció akkor is hasznos, ha olyan vezérlőelemet szeretne létrehozni, amely az UserControlElemleírás ablakokat megjelenítő számos vezérlőt tartalmaz. Mivel gyakran UserControl nem az aktív ablak egy űrlapon, ezt a tulajdonságot úgy kell beállítani, hogy true a vezérlők bármikor megjeleníthessenek UserControl elemleírási ablakokat.