Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(e)
Dim g As Graphics = e.Graphics
'获取按钮边框路径
Dim path As GraphicsPath = GetRoundedRectPath(e.ClipRectangle)
Dim blueBrush As New SolidBrush(_MainPagesTabBackColorSelected)
Select Case _ButtonState
Case 1 '进入
blueBrush = New SolidBrush(Color.Magenta)
Case 2 '按下
blueBrush = New SolidBrush(Color.Red)
End Select
If _ButtonState = 1 Or _ButtonState = 2 Then
'g.FillPath(blueBrush, path)
g.FillRectangle(blueBrush,e.ClipRectangle.X,e.ClipRectangle.y,e.ClipRectangle.Width,e.ClipRectangle.height)
End If
'画关闭符号
Using p As Pen = New Pen(Color.Black, 1)
'画"\"线
Dim p1 As Point = New Point(e.ClipRectangle.X + 5, e.ClipRectangle.Y + 5)
Dim p2 As Point = New Point(e.ClipRectangle.X + e.ClipRectangle.Width - 5, e.ClipRectangle.Y + e.ClipRectangle.Height - 5)
g.DrawLine(p, p1, p2)