Sdílet prostřednictvím


Postupy: Nastavení popisů ovládacích prvků ve formuláři Windows Form v době návrhu

Můžete nastavit řetězec ToolTip v kódu nebo v návrháři Windows Forms ve Visual Studio. Další informace o komponentě ToolTip naleznete v tématu ToolTip Component Overview.

Programové nastavení ToolTipu

  1. Přidejte ovládací prvek, který zobrazí nápovědu (ToolTip).

  2. Použijte SetToolTip metodu komponenty ToolTip.

    ' 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");
    

Nastavit popisek v návrháři

  1. Ve Visual Studio přidejte do formuláře komponentu ToolTip.

  2. Vyberte ovládací prvek, který zobrazí popis, nebo ho přidejte do formuláře.

  3. V okně Vlastnosti nastavte popis tlačítka na popisku 1 hodnotu odpovídajícího řetězce textu.

Jak programově odebrat ToolTip

  1. Použijte SetToolTip metodu komponenty ToolTip.

    ' 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);
    

Odebrat bublinovou nápovědu v návrháři

  1. Ve Visual Studio vyberte ovládací prvek, který zobrazuje nápovědu.

  2. V okně Vlastnosti odstraňte text v popisku vtoolTip1 .

Viz také