DataGridViewColumn.ToolTipText DataGridViewColumn.ToolTipText DataGridViewColumn.ToolTipText DataGridViewColumn.ToolTipText Property

定義

取得或設定供工具提示使用的文字。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

屬性值

要顯示為資料行之工具提示的文字。The text to display as a ToolTip for the column.

範例

下列程式碼範例顯示如何設定資料行的工具提示。The following code example shows how to set a column's ToolTip. 這個程式碼範例是針對DataGridViewColumn類別提供的較大程式碼範例的一部分。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

備註

當滑鼠指標停留在資料行標頭上時,就會顯示資料行的工具提示。The column's ToolTip displays when the mouse pointer rests on the column header.

適用於

另請參閱