Udostępnij przez


Instrukcje: ustawianie narzędzia Wskazówki dla kontrolek w formularzu systemu Windows w czasie projektowania

Możesz ustawić ToolTip ciąg w kodzie lub w Projektant Windows Forms w programie Visual Studio. Aby uzyskać więcej informacji na temat ToolTip składnika, zobacz ToolTip Component Overview (Omówienie składnika Etykietka narzędzia).

Programowe ustawianie etykietki narzędzi

  1. Dodaj kontrolkę, która będzie wyświetlać etykietkę narzędzia.

  2. SetToolTip Użyj metody ToolTip składnika.

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

Ustawianie etykietki narzędzia w projektancie

  1. W programie Visual Studio dodaj ToolTip składnik do formularza.

  2. Wybierz kontrolkę, która wyświetli etykietkę narzędzia lub dodaj ją do formularza.

  3. W oknie Właściwości ustaw wartość Etykietka narzędzia w etykietce narzędzia1 na odpowiedni ciąg tekstu.

Aby programowo usunąć etykietkę narzędzia

  1. SetToolTip Użyj metody ToolTip składnika.

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

Usuwanie etykietki narzędzia w projektancie

  1. W programie Visual Studio wybierz kontrolkę, która wyświetla etykietkę narzędzia.

  2. W oknie Właściwości usuń tekst w etykietce narzędzia w etykietce narzędzia1.

Zobacz też