Formularkanten abrunden
Hier erfahren Sie, wie die Kanten eines Formulars abgerundet werden.
Public function Meround(ByVal Obj As Object, ByVal Left As Integer, ByVal Top As Integer, ByVal Width As Integer, ByVal Height As Integer, ByVal Radius As Integer)
Try Fehlerhandle
Dim gr As New System.Drawing.Drawing2D.GraphicsPath()
gr.AddLine(Left + Radius, Top, Left + Width - Radius, Top)
gr.AddArc(Left + Width - Radius, Top, Radius, Radius, 270, 90)
gr.AddLine(Left + Width, Top + Radius, Left + Width, Top + Height - Radius)
gr.AddArc(Left + Width - Radius, Top + Height - Radius, Radius, Radius, 0, 90)
gr.AddLine(Left + Width - Radius, Top + Height, Left + Radius, Top + Height)
gr.AddArc(Left, Top + Height - Radius, Radius, Radius, 90, 90)
gr.AddLine(Left, Top + Height - Radius, Left, Top + Radius)
gr.AddArc(Left, Top, Radius, Radius, 180, 90)
gr.CloseFigure()
Obj.Region = New System.Drawing.Region(gr)
gr.Dispose()
Catch
End Try
End function
Per Load-Ereignis starten Me=Objekt (formular)
Private Sub Frm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Meround(Me, 0, 0, Me.Width, Me.Height, 40)
End Sub