Private Sub roundCorners(obj As Panel)
Dim DGP As New Drawing2D.GraphicsPath
DGP.StartFigure()
'top left corner
DGP.AddArc(New Rectangle(0, 0, 20, 20), 180, 90)
DGP.AddLine(40, 0, obj.Width - 20, 0)
'top right corner
DGP.AddArc(New Rectangle(obj.Width - 20, 0, 20, 20), -90, 90)
DGP.AddLine(obj.Width, 40, obj.Width, obj.Height - 20)
'buttom right corner
DGP.AddArc(New Rectangle(obj.Width - 20, obj.Height - 20, 20, 20), 0, 90)
DGP.AddLine(obj.Width - 20, obj.Height, 20, obj.Height)
'buttom left corner
DGP.AddArc(New Rectangle(0, obj.Height - 20, 20, 20), 90, 90)
DGP.CloseFigure()
obj.Region = New Region(DGP)
End Sub