共用方式為


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

備註

資料行的工具提示會在滑鼠指標停留在資料行標頭上時顯示。

適用於

另請參閱