Imports System.Drawing
Imports System.Windows.Forms

Public Class RectForm
  Inherits System.Windows.Forms.Form
  Dim rect As VBPats.Rectangle
  Dim sq As VBPats.Rectangle
  'Dim dbl As VBPats.DoubleRect

  Private Sub init()
    rect = New VBPats.Rectangle(20, 50, 200, 100)
    sq = New VBPats.Square(90, 60, 70)
    'dbl = New VBPats.DoubleRect(50, 70, 60, 90)
  End Sub

  Public Sub New()
    MyBase.New()
    Form1 = Me
    'This call is required by the Win Form Designer.
    InitializeComponent()
    init()
  End Sub

  'Form overrides dispose to clean up the component list.
  Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    MyBase.Dispose(disposing)
    components.Dispose()
  End Sub

  Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
    Dim g As Graphics
    g = e.Graphics
    rect.draw(g)
    sq.draw(g)
    'dbl.draw(g)
  End Sub

#Region " Windows Form Designer generated code "

  'Required by the Windows Form Designer
  Private components As System.ComponentModel.Container


  Dim WithEvents Form1 As System.Windows.Forms.Form

  'NOTE: The following procedure is required by the Windows Form Designer
  'It can be modified using the Windows Form Designer.  
  'Do not modify it using the code editor.
  Private Sub InitializeComponent()
    Me.components = New System.ComponentModel.Container()
    '@design Me.TrayHeight = 0
    '@design Me.TrayLargeIcon = False
    '@design Me.TrayAutoArrange = True
    Me.Text = " Rectangle Form"
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.ClientSize = New System.Drawing.Size(304, 181)

  End Sub

#End Region

End Class
