Change the mouse pointer on a datagrid column

Hello, i want to change the mouse cursor (default to hand) when i am on the first column (only the first) of my datagrid. i try this code and it don't work : Private Sub DataGrid1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseMove Dim hti As system.Windows.Forms.DataGrid.HitTestInfo hti = DataGrid1.HitTest(e.X, e.Y) If hti.Type = System.Windows.Forms.DataGrid.HitTestType.Cell Then If hti.Column = 1 Then DataGrid1.Cursor = System.Windows.Forms.Cursors.Hand Cursor.Current = System.Windows.Forms.Cursors.Hand End If End If End Sub

2 Replies

AD Administrator Syncfusion Team August 13, 2003 09:40 PM UTC

> Hello, > > i want to change the mouse cursor (default to hand) when i am on the first column (only the first) of my datagrid. > > i try this code and it don't work : > > Private Sub DataGrid1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseMove > Dim hti As system.Windows.Forms.DataGrid.HitTestInfo > hti = DataGrid1.HitTest(e.X, e.Y) > If hti.Type = System.Windows.Forms.DataGrid.HitTestType.Cell Then > If hti.Column = 1 Then > DataGrid1.Cursor = System.Windows.Forms.Cursors.Hand > Cursor.Current = System.Windows.Forms.Cursors.Hand > End If > End If > End Sub >


AK Ankur Kalsi October 24, 2003 08:27 PM UTC

Can you please send me a sample code to do this?

Loader.
Up arrow icon