Postupy: Nastavení nástroje Tipy pro ovládací prvky ve formuláři Windows Při návrhu
Řetězec můžete nastavit ToolTip v kódu nebo v návrháři model Windows Forms v sadě Visual Studio. Další informace o komponentě ToolTip naleznete v tématu ToolTip Component Overview.
Programové nastavení popisu
Přidejte ovládací prvek, který zobrazí popis.
SetToolTip Použijte metodu ToolTip komponenty.
' In this example, Button1 is the control to display the ToolTip. ToolTip1.SetToolTip(Button1, "Save changes")
// In this example, button1 is the control to display the ToolTip. toolTip1.SetToolTip(button1, "Save changes");
// In this example, button1 is the control to display the ToolTip. toolTip1->SetToolTip(button1, "Save changes");
Nastavení popisu v návrháři
V sadě Visual Studio přidejte do formuláře komponentu ToolTip .
Vyberte ovládací prvek, který zobrazí popis, nebo ho přidejte do formuláře.
V okně Vlastnosti nastavte popis u hodnoty ToolTip1 na odpovídající řetězec textu.
Odebrání popisu prostřednictvím kódu programu
SetToolTip Použijte metodu ToolTip komponenty.
' In this example, Button1 is the control displaying the ToolTip. ToolTip1.SetToolTip(Button1, Nothing)
// In this example, button1 is the control displaying the ToolTip. toolTip1.SetToolTip(button1, null);
// In this example, button1 is the control displaying the ToolTip. toolTip1->SetToolTip(button1, NULL);
Odebrání popisu v návrháři
V sadě Visual Studio vyberte ovládací prvek, který zobrazuje popis.
V okně Vlastnosti odstraňte text v popisu v popisku 1.
Viz také
.NET Desktop feedback
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro