Bewerken

Delen via


DataGridViewColumn.ToolTipText Property

Definition

Gets or sets the text used for ToolTips.

public:
 property System::String ^ ToolTipText { System::String ^ get(); void set(System::String ^ value); };
public string ToolTipText { get; set; }
member this.ToolTipText : string with get, set
Public Property ToolTipText As String

Property Value

The text to display as a ToolTip for the column.

Examples

The following code example shows how to set a column's ToolTip. This code example is part of a larger code example provided for the DataGridViewColumn class.

void ToolTips()
{
   DataGridViewColumn^ firstColumn = dataGridView->Columns[ 0 ];
   DataGridViewColumn^ thirdColumn = dataGridView->Columns[ 2 ];
   firstColumn->ToolTipText = L"This column uses a default cell.";
   thirdColumn->ToolTipText = L"This column uses a template cell."
   L" Style changes to one cell apply to all cells.";
}
private void ToolTips()
{
    DataGridViewColumn firstColumn = dataGridView.Columns[0];
    DataGridViewColumn thirdColumn = dataGridView.Columns[2];
    firstColumn.ToolTipText =
        "This column uses a default cell.";
    thirdColumn.ToolTipText =
        "This column uses a template cell." +
        " Style changes to one cell apply to all cells.";
}
Private Sub ToolTips()
    Dim firstColumn As DataGridViewColumn = _
        dataGridView.Columns(0)
    Dim thirdColumn As DataGridViewColumn = _
        dataGridView.Columns(2)
    firstColumn.ToolTipText = _
        "This is column uses a default cell."
    thirdColumn.ToolTipText = _
        "This is column uses a template cell." _
        & " Changes to one cell's style changes them all."
End Sub

Remarks

The column's ToolTip displays when the mouse pointer rests on the column header.

Applies to

See also