DataGridViewColumn.ToolTipText 属性

定义

获取或设置用于工具提示的文本。

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

属性值

作为该列的工具提示所显示的文本。

示例

下面的代码示例演示如何设置列的工具提示。 此代码示例是为 类提供的更大代码示例的 DataGridViewColumn 一部分。

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

注解

当鼠标指针停留在列标题上时,将显示列的工具提示。

适用于

另请参阅