vb.net隐藏边框 vb怎么隐藏按钮

vb.net 无边框窗体的问题设置窗体的text为空,设置窗体的controlbox属性为false,设置窗体的FormBorderStyle 属性为Sizable,就可以改变窗体大小了 , 并且可以在任务栏点击 。
VB.NET 如何去掉 GroupBox 控件的边框?工程里面添加一个类,命名为myGroupBox,代码如下:
Imports System.ComponentModel
Imports System.Drawing.Drawing2D
Public Class myGroupBox
Inherits GroupBox
Public Sub New()
MyBase.BackColor = Color.Transparent
End Sub
Browsable(False) _
Public Overrides Property BackColor() As Color
Get
Return MyBase.BackColor
End Get
Set(value As Color)
MyBase.BackColor = value
End Set
End Property
Private m_backColor As Color = Color.Transparent
Public Property ActualBackColor() As Color
Get
Return Me.m_backColor
End Get
Set(value As Color)
Me.m_backColor = value
End Set
End Property
Protected Overrides Sub OnPaint(e As PaintEventArgs)
Dim tSize As Size = TextRenderer.MeasureText(Me.Text, Me.Font)
Dim borderRect As Rectangle = e.ClipRectangle
borderRect.Y += tSize.Height / 2
borderRect.Height -= tSize.Height / 2
Dim gPath As GraphicsPath = CreatePath(0, borderRect.Y, CSng(Me.Width - 1), borderRect.Height - 1, 5, True, _
True, True, True)
e.Graphics.FillPath(New SolidBrush(ActualBackColor), gPath)
e.Graphics.DrawPath(New Pen(Me.BackColor), gPath)
borderRect.X += 6
borderRect.Y -= 7
e.Graphics.DrawString(Me.Text, Me.Font, New SolidBrush(Me.ForeColor), borderRect)
End Sub
Public Function CreatePath(x As Single, y As Single, width As Single, height As Single, radius As Single, _
RoundTopLeft As Boolean, RoundTopRight As Boolean, RoundBottomRight As Boolean, RoundBottomLeft As Boolean) As GraphicsPath
Dim xw As Single = x + width
Dim yh As Single = y + height
Dim xwr As Single = xw - radius
Dim yhr As Single = yh - radius
Dim xr As Single = x + radius
Dim yr As Single = y + radius
Dim r2 As Single = radius * 2
Dim xwr2 As Single = xw - r2
Dim yhr2 As Single = yh - r2
Dim p As New GraphicsPath()
p.StartFigure()
'Top Left Corner
If RoundTopLeft Then
p.AddArc(x, y, r2, r2, 180, 90)
Else
p.AddLine(x, yr, x, y)
p.AddLine(x, y, xr, y)
End If
'Top Edge
p.AddLine(xr, y, xwr, y)
'Top Right Corner
If RoundTopRight Then
p.AddArc(xwr2, y, r2, r2, 270, 90)
Else
p.AddLine(xwr, y, xw, y)
p.AddLine(xw, y, xw, yr)
End If
'Right Edge
p.AddLine(xw, yr, xw, yhr)
'Bottom Right Corner
If RoundBottomRight Then
p.AddArc(xwr2, yhr2, r2, r2, 0, 90)
Else
p.AddLine(xw, yhr, xw, yh)
p.AddLine(xw, yh, xwr, yh)
End If
'Bottom Edge
p.AddLine(xwr, yh, xr, yh)
'Bottom Left Corner
If RoundBottomLeft Then
p.AddArc(x, yhr2, r2, r2, 90, 90)
Else
p.AddLine(xr, yh, x, yh)
p.AddLine(x, yh, x, yhr)
End If
'Left Edge
p.AddLine(x, yhr, x, yr)
p.CloseFigure()
Return p
End Function
End Class
工具栏会出现一个myGroupBox控件,放入窗体,你会发现边框没了 。
在VB.net中,Tabcontrol控件的边框怎么去掉?你把 选项卡 拖到屏幕外面不就行vb.net隐藏边框了 只显示选项卡内东西 周围边缘都不要vb.net隐藏边框了 每个选项卡内配合labl 或按钮 标识不就行了 。
【vb.net隐藏边框 vb怎么隐藏按钮】关于vb.net隐藏边框和vb怎么隐藏按钮的介绍到此就结束了 , 不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

    推荐阅读