Advertisement
6_2008-2009 Graphics/ Sound #211870

Clip edges of forms to give that rounded feel

This code will round the edges of your form to give that clipped/rounded look.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
 Dim Pth As New GraphicsPath(), pc As Decimal = 0.18
 Pth.AddEllipse(New Rectangle(-Me.Width * pc, -Me.Height * pc, Me.Width * (1 + 2 * pc), Me.Height * (1 + 2 * pc)))
 Me.Region = New Region(Pth)
End Sub
Original Comments (3)
Recovered from Wayback Machine