public class notcresizegrid
inherits system.windows.forms.datagrid
#region " windows 窗体设计器生成的代码 "
public sub new()
mybase.new()
'该调用是 windows 窗体设计器所必需的。
initializecomponent()
'在 initializecomponent() 调用之后添加任何初始化
end sub
'usercontrol 重写 dispose 以清理组件列表。
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 窗体设计器所必需的
private components as system.componentmodel.icontainer
'注意:以下过程是 windows 窗体设计器所必需的
'可以使用 windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
<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 hti.type = datagrid.hittesttype.columnresize then
cursor.current = cursors.default
return
end if
mybase.onmousemove(e)
end sub end class
新闻热点
疑难解答