G
Guest
Hi there,
I've tried everything that I know to prevent usre resizing datagrid columns,
but nothing works. Following are the code that I used. Please tell me
what's wrong with them. Thank you.
P.S.: dg is datagrid
Protected Overrides Sub OnMouseDown(ByVal e As
System.Windows.Forms.MouseEventArgs)
Dim hti As DataGrid.HitTestInfo = me.dg.HitTest(New Point(e.X, e.Y))
If hti.Type = DataGrid.HitTestType.ColumnResize Then
Return 'no baseclass call
End If
MyBase.OnMouseDown(e)
End Sub
Protected Overrides Sub OnMouseMove(ByVal e As
System.Windows.Forms.MouseEventArgs)
Dim hti As DataGrid.HitTestInfo = me.dg.HitTest(New Point(e.X, e.Y))
If hti.Type = DataGrid.HitTestType.ColumnResize Then
Return 'no baseclass call
End If
MyBase.OnMouseMove(e)
End Sub
Private Sub dg_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles dgPond.MouseDown
Dim hti As DataGrid.HitTestInfo = Me.dg.HitTest(New
Point(e.X, e.Y))
If hti.Type = DataGrid.HitTestType.ColumnResize Then
Return 'no baseclass call
End If
MyBase.OnMouseDown(e)
End Sub
Private Sub dg_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles dgPond.MouseMove
Dim hti As DataGrid.HitTestInfo = Me.dg.HitTest(New Point(e.X, e.Y))
If hti.Type = DataGrid.HitTestType.ColumnResize Then
Return 'no baseclass call
End If
MyBase.OnMouseMove(e)
End Sub
I've tried everything that I know to prevent usre resizing datagrid columns,
but nothing works. Following are the code that I used. Please tell me
what's wrong with them. Thank you.
P.S.: dg is datagrid
Protected Overrides Sub OnMouseDown(ByVal e As
System.Windows.Forms.MouseEventArgs)
Dim hti As DataGrid.HitTestInfo = me.dg.HitTest(New Point(e.X, e.Y))
If hti.Type = DataGrid.HitTestType.ColumnResize Then
Return 'no baseclass call
End If
MyBase.OnMouseDown(e)
End Sub
Protected Overrides Sub OnMouseMove(ByVal e As
System.Windows.Forms.MouseEventArgs)
Dim hti As DataGrid.HitTestInfo = me.dg.HitTest(New Point(e.X, e.Y))
If hti.Type = DataGrid.HitTestType.ColumnResize Then
Return 'no baseclass call
End If
MyBase.OnMouseMove(e)
End Sub
Private Sub dg_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles dgPond.MouseDown
Dim hti As DataGrid.HitTestInfo = Me.dg.HitTest(New
Point(e.X, e.Y))
If hti.Type = DataGrid.HitTestType.ColumnResize Then
Return 'no baseclass call
End If
MyBase.OnMouseDown(e)
End Sub
Private Sub dg_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles dgPond.MouseMove
Dim hti As DataGrid.HitTestInfo = Me.dg.HitTest(New Point(e.X, e.Y))
If hti.Type = DataGrid.HitTestType.ColumnResize Then
Return 'no baseclass call
End If
MyBase.OnMouseMove(e)
End Sub