No adjustment column width

xiaoxiao2021-03-05  30

Public Class NotcresizeGrid

Inherits System.Windows.Forms.DataGrid

#Region "Windows Form Designer Generated Code"

Public Sub New ()

Mybase.new ()

'This call is required for the Windows Form Designer.

InitializeComponent ()

'Add any initialization after INITIALIZECOMPONENT ()

End Sub

'UserControl overrides Dispose to clean the component list.

Protected Overloads Overrides Sub Dispose (Byval Disposing as Boolean)

IF Disposing then

IF not (Components Is Nothing) THEN

Components.dispose ()

END IF

END IF

Mybase.dispose (Disposing)

End Sub

'Windows Form Designer

Private Components as System.comPonentModel.icontainer

'Note: The following process is necessary for the Windows Form Designer.

'You can modify this process using the Windows Form Designer.

'Don't modify it using the code editor.

private subinitializecomponent ()

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))

'Returns if the mouse event is changed to change the column width

If hti.type = datagrid.hittesttype.columnresize kil

Cursor.current = Cursors.default

Return

END IF

Mybase.onmousemove (e)

End Sub

END CLASS

转载请注明原文地址:https://www.9cbs.com/read-33593.html

New Post(0)