3. Code for the printDocument1
• using System;
• using System.Collections.Generic;
• using System.ComponentModel;
• using System.Data;
• using System.Drawing;
• using System.Linq;
• using System.Text;
• using System.Threading.Tasks;
• using System.Windows.Forms;
• namespace WindowsFormsApplication17
• {
• public partial class Form1 : Form
• {
• public Form1()
• {
• InitializeComponent();
• }
9. Form1.vb
• Imports System.Drawing
• Public Class Form1
• Dim g As System.Drawing.Graphics
• Dim pen1 As New System.Drawing.Pen(Color.Blue, 2)
• Dim f As New Font("Times new roman", 30)
• Private Sub show_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
• g = Me.CreateGraphics
• g.DrawLine(pen1, 250, 50, 30, 20)
• g.DrawEllipse(pen1, 50, 50, 100, 100)
• g.DrawString("hello", f, Brushes.Brown, 300, 100)
• End Sub
• Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
• End Sub
• End Class