Public Class Form1
Private WithEvents PnlShow As New Panel
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Size = New Size(600, 600)
PnlShow.Size = New Size(500, 500)
PnlShow.BorderStyle = BorderStyle.FixedSingle
PnlShow.Location = New Point(50, 50)
Me.Controls.Add(PnlShow)
End Sub
Private Sub PnlShow_Paint(sender As Object, e As PaintEventArgs) Handles PnlShow.Paint
Dim MaxX As Integer = PnlShow.Width - 25
Dim MaxY As Integer = PnlShow.Height - 25
For y As Integer = 25 To MaxY Step 50
e.Graphics.DrawLine(Pens.Black, 25, y, MaxX, y)
e.Graphics.DrawString(y, Me.Font, SystemBrushes.AppWorkspace, MaxX + 5, y)
Next
For x As Integer = 25 To MaxX Step 50
e.Graphics.DrawLine(Pens.Black, x, 25, x, MaxY)
e.Graphics.DrawString(x, Me.Font, Brushes.Black, x, MaxY + 5)
Next
e.Graphics.DrawBezier(Pens.Red, New Point(25, 25), New Point(50, 300), New Point(200, 400), New Point(450, 450))
End Sub
End Class