Datagrid
Public Class Notcresizegrid
Inherits System.Windows.Forms.DataGrid
#Region "code generated by the Windows forms Designer"
Public Sub New ()
MyBase.New ()
' This call is required by the Windows Forms Designer.
InitializeComponent ()
' Add any initialization after the InitializeComponent () call
End Sub
' UserControl overrides dispose to clean up the list of components.
Protected Overloads Overrides Sub Dispose (ByVal disposing as Boolean)
If disposing Then
If not (components are nothing) Then
Components. Dispose ()
End If
End If
Mybase.dispose (disposing)
End Sub
' Required by the Windows Forms Designer
Private Components as System.ComponentModel.IContainer
' NOTE: The following procedure is required by the Windows Forms Designer
' You can use the Windows Forms Designer to modify this procedure.
' Do not modify it using the Code Editor.
<system.diagnostics.debuggerstepthrough () > Private Sub InitializeComponent ()
components = New System.ComponentModel.Container ()
End Sub
#End Region
Protected Overrides Sub OnMouseDown (ByVal e as System.Windows.Forms.MouseEventArgs)
Dim Hti as System.Windows.Forms.DataGrid.HitTestInfo
Hti = Me.hittest (e.x, e.y)
Select case Hti. Type
Case DataGrid.HitTestType.ColumnResize
Return
End Select
Mybase.onmousedown (e)
End Sub
Protected Overrides Sub OnMouseMove (ByVal e as System.Windows.Forms.MouseEventArgs)
Dim hti as Datagrid.hittestinfo = Me.hittest (New point (e.x, e.y))
' If the mouse event type is changing the column width, return
If Hti. Type = DataGrid.HitTestType.ColumnResize Then
Cursor.current = Cursors.Default
Return
End If
Mybase.onmousemove (e)
End Sub End Class