Public Class Form1 Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click Dim paper As Graphics paper = PictureBox1.CreateGraphics() paper.Clear(Color.White) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim paper, drwarea As Graphics Dim mypen As Pen paper = PictureBox1.CreateGraphics() drwarea = paper mypen = New Pen(Color.Blue, 3) Dim mypencil, ballp, x As Pen mypencil = New Pen(Color.Red, 1) ballp = mypencil x = mypencil 'paper.DrawRectangle(mypen, 30, 10, PictureBox1.Width - 2 * 30, _ ' PictureBox1.Height - 2 * 10) ''MessageBox.Show("Rectangle has been drawn") 'paper.DrawEllipse(mypen, 30, 10, PictureBox1.Width - 2 * 30, _ ' PictureBox1.Height - 2 * 10) ''MessageBox.Show("Ellipse has been drawn") 'drwarea.DrawLine(mypen, 100, 10, 200, 150) 'paper.DrawLine(x, 10, 150, 200, 150) 'paper.DrawLine(mypen, 10, 150, 100, 10) paper.DrawRectangle(mypen, 5, 5, PictureBox1.Width - 10, PictureBox1.Height - 10) End Sub End Class