ricky92
Member
Hello, I am developing a custom OSX-style form, drawing it on the fly. However, I'm experiencing a problem making the main shape of the form, where a line is bolder than it should be. Here's a screenshot:
See? The corners at the other angles are just fine, while the one at the top-left is bolder than the others. The code is the following:
Any help, please? :\
See? The corners at the other angles are just fine, while the one at the top-left is bolder than the others. The code is the following:
VB.NET:
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Dim g As Graphics = e.Graphics
Dim gp As New GraphicsPath(FillMode.Winding)
gp.StartFigure()
gp.AddLine(New PointF(0, 3), New Point(3, 0))
gp.AddLine(New PointF(Me.ClientSize.Width - 3.5, 0), New PointF(Me.ClientSize.Width, 3.5))
gp.AddLine(New PointF(Me.ClientSize.Width, Me.ClientSize.Height - 4.5), New PointF(Me.ClientSize.Width - 4.5, Me.ClientSize.Height))
gp.AddLine(New PointF(3.5, Me.ClientSize.Height), New PointF(0, Me.ClientSize.Height - 3.5))
gp.CloseFigure()
g.FillPath(New LinearGradientBrush(New Point(0, 0), New Point(0, Me.ClientSize.Height), Color.Gainsboro, Color.DarkGray), gp)
g.DrawPath(New Pen(Color.FromArgb(96, 96, 96), 2), gp)
End Sub
Any help, please? :\