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
新聞熱點
疑難解答