Public Class Form1

    Private Sub Form1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Click
        Dim g As Graphics = Me.CreateGraphics()     '生成图形对象 
        Dim Mypen As New Pen(Color.Blue, 2)         '生成画笔,蓝色，2个像素 
        g.DrawRectangle(Mypen, 5, 5, 80, 40)        '画矩形 
        Dim rect As New Rectangle(95, 15, 140, 50)  '生成矩形 
        g.DrawRectangle(Mypen, rect)                '画矩形 
    End Sub

End Class
