Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i, r As Integer
        '获取对将用于绘图的图形对象的引用创建图形图像。 
        r = 10
        Dim g As Graphics = PictureBox1.CreateGraphics()
        Dim myPen As New Pen(Color.Red)
        myPen.Width = 1
        For i = 0 To 8 '竖线
            If i = 0 Or i = 8 Then
                myPen.Width = 2
            Else
                myPen.Width = 1
            End If
            g.DrawLine(myPen, r + i * 2 * r, r, r + i * 2 * r, r * 2 * 10 - r + 1)
        Next
        For i = 0 To 9 '横线
            If i = 0 Or i = 9 Then
                myPen.Width = 2
            Else
                myPen.Width = 1
            End If
            g.DrawLine(myPen, r, r + i * 2 * r, r * 2 * 9 - r, r + i * 2 * r)
        Next
        Dim rectangle As New Rectangle(r + 1, r + r * 8 + 1, r * 9 * 2 - 2 * r - 2, 2 * r - 2)
        Dim brush1 As New Drawing.SolidBrush(Color.White)
        g.FillRectangle(brush1, rectangle)
        Dim font1 As Font = New Font("Arial", 14)
        Dim brush2 As New SolidBrush(Color.Black)
        g.DrawString("  楚河        汉界", font1, brush2, (r + 1), (r + r * 8 + 1))
        '画九宫斜线
        g.DrawLine(myPen, r + r * 6 + 1, r + 1, r + r * 6 + r * 4 - 1, r + r * 4 - 1)
        g.DrawLine(myPen, r + r * 6 + 1, r + r * 4 - 1, r + r * 6 + r * 4 - 1, r + 1)
        g.DrawLine(myPen, r + r * 6 + 1, r * 14 + r + 1, r + r * 6 + r * 4 - 1, r * 14 + r + r * 4 - 1)
        g.DrawLine(myPen, r + r * 6 + 1, r * 14 + r + r * 4 - 1, r + r * 6 + r * 4 - 1, r * 14 + r + 1)
    End Sub

End Class
