I'm trying to create a custom button for an application in VB.net: more specifically, this is what I'd like my control to look like.
I've managed to find a tutorial explaining how to reshape a control using GraphicsPath, and thanks to that I've managed to bring the button to that size: however, after doing that I can't draw the other pieces of the picture. This is the code I've been using:
Protected Overrides Sub OnPaint(e As PaintEventArgs)
Dim factor As Integer = Me.Width / 12
Dim pts() As Point = {
New Point(0, 0),
New Point(factor * 12, 0),
New Point(factor * 12, factor * 4),
New Point(factor * 8, factor * 8),
New Point(0, factor * 8)
}
Dim polygonPath As New GraphicsPath(FillMode.Winding)
polygonPath.AddPolygon(pts)
Dim polygonRegion = New Region(polygonPath)
Me.Region = polygonRegion
e.Graphics.FillRectangle(Brushes.Blue, New Rectangle(factor, factor, factor * 7, factor * 6))
MyBase.OnPaint(e)
End Sub
Am I doing something wrong? Can anyone tell me how to draw the remaining shapes on the button?