vb.net 的tabcontrol控件的page边框显示多余,把其他控件放上去,有影响显示效果,以下方法可以解决这个问题,可以根据类里的left,top,width,height调整加减值改变显示结果。
代码如下:
先建立一个类
Public Class FullTabControl
Inherits TabControl
Public Overrides ReadOnly Property DisplayRectangle() As Rectangle
Get
Dim rect As Rectangle = MyBase.DisplayRectangle
Return New Rectangle(rect.Left - 5, rect.Top - 0, rect.Width + 0, rect.Height + 0)
End Get
End Property
End Class
打开Form 窗体
打开designer.vb
找到控件:tabcontrol1=new system.windwos.forms.tabcontrol()
修改为:tabcontrol1 =new fulltabcontrol()