1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Public Class ControlMiska
Inherits UserControl
Private Sub Miska_Paint(sender As System.Object, e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim thePen As New Pen(Brushes.Red, 10)
thePen.Alignment = Drawing2D.PenAlignment.Center
thePen.LineJoin = Drawing2D.LineJoin.Bevel
thePen.SetLineCap(Drawing2D.LineCap.AnchorMask, Drawing2D.LineCap.AnchorMask, Drawing2D.DashCap.Triangle)
Dim rect As New Rectangle(50, 50, 300, 150)
Dim pointTopLeft As Point = New Point(rect.Height - 1, 10)
Dim pointBottomLeft As Point = New Point(rect.Height - 1, rect.Height - 1)
Dim pointTopRight As Point = New Point(rect.Width - 1, 10)
Dim pointBottomRight As Point = New Point(rect.Width - 1, rect.Height - 1)
e.Graphics.DrawLine(thePen, pointTopLeft, pointBottomLeft)
thePen.Brush = Brushes.Green
e.Graphics.DrawLine(thePen, pointTopLeft, pointTopRight)
thePen.Brush = Brushes.Yellow
e.Graphics.DrawLine(thePen, pointBottomRight, pointTopRight)
thePen.Brush = Brushes.Pink
e.Graphics.DrawLine(thePen, pointBottomLeft, pointBottomRight)
End Sub
End Class |
Partager