Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub roundCorners(obj As Form)
- obj.FormBorderStyle = FormBorderStyle.None
- obj.BackColor = Color.Cyan
- Dim DGP As New Drawing2D.GraphicsPath
- DGP.StartFigure()
- 'top left corner
- DGP.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)
- DGP.AddLine(40, 0, obj.Width - 40, 0)
- 'top right corner
- DGP.AddArc(New Rectangle(obj.Width - 40, 0, 40, 40), -90, 90)
- DGP.AddLine(obj.Width, 40, obj.Width, obj.Height - 40)
- 'buttom right corner
- DGP.AddArc(New Rectangle(obj.Width - 40, obj.Height - 40, 40, 40), 0, 90)
- DGP.AddLine(obj.Width - 40, obj.Height, 40, obj.Height)
- 'buttom left corner
- DGP.AddArc(New Rectangle(0, obj.Height - 40, 40, 40), 90, 90)
- DGP.CloseFigure()
- obj.Region = New Region(DGP)
- End Sub
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- roundCorners(Me)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement