如何更改光标箭头。我有10列,我想在第一列上更改光标。
答案 0 :(得分:1)
如果您依赖CellMouseEnter
事件,您可以轻松获得所需内容。在这里,您有DataGridView1
和第1列的工作代码:
Private Sub DataGridView1_CellMouseEnter(sender As Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellMouseEnter
If (e.ColumnIndex = 0) Then
Cursor = Cursors.Hand 'Different cursor when the mouse is over a cell belonging to column 1
Else
Cursor = Cursors.Default
End If
End Sub
答案 1 :(得分:0)
如果index = firstColumn则
Cursor = Cursors.hand
ENDIF