Public Class Form1
  Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

  Public Sub New()
    MyBase.New()

    'This call is required by the Windows Form Designer.
    InitializeComponent()

    'Add any initialization after the InitializeComponent() call

  End Sub

  'Form overrides dispose to clean up the component list.
  Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    If disposing Then
      If Not (components Is Nothing) Then
        components.Dispose()
      End If
    End If
    MyBase.Dispose(disposing)
  End Sub
  Friend WithEvents Label1 As System.Windows.Forms.Label
  Friend WithEvents txName As System.Windows.Forms.TextBox
  Friend WithEvents txFirst As System.Windows.Forms.TextBox
  Friend WithEvents txLast As System.Windows.Forms.TextBox
  Friend WithEvents Label2 As System.Windows.Forms.Label
  Friend WithEvents btCompute As System.Windows.Forms.Button
  Friend WithEvents btClear As System.Windows.Forms.Button

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

  '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.
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.Label1 = New System.Windows.Forms.Label()
    Me.Label2 = New System.Windows.Forms.Label()
    Me.txFirst = New System.Windows.Forms.TextBox()
    Me.txLast = New System.Windows.Forms.TextBox()
    Me.btCompute = New System.Windows.Forms.Button()
    Me.txName = New System.Windows.Forms.TextBox()
    Me.btClear = New System.Windows.Forms.Button()
    Me.SuspendLayout()
    '
    'Label1
    '
    Me.Label1.Location = New System.Drawing.Point(32, 112)
    Me.Label1.Name = "Label1"
    Me.Label1.Size = New System.Drawing.Size(72, 16)
    Me.Label1.TabIndex = 3
    Me.Label1.Text = "First name"
    '
    'Label2
    '
    Me.Label2.Location = New System.Drawing.Point(32, 144)
    Me.Label2.Name = "Label2"
    Me.Label2.Size = New System.Drawing.Size(64, 16)
    Me.Label2.TabIndex = 4
    Me.Label2.Text = "Last name"
    '
    'txFirst
    '
    Me.txFirst.Location = New System.Drawing.Point(120, 104)
    Me.txFirst.Name = "txFirst"
    Me.txFirst.Size = New System.Drawing.Size(80, 20)
    Me.txFirst.TabIndex = 1
    Me.txFirst.Text = ""
    '
    'txLast
    '
    Me.txLast.Location = New System.Drawing.Point(120, 144)
    Me.txLast.Name = "txLast"
    Me.txLast.Size = New System.Drawing.Size(80, 20)
    Me.txLast.TabIndex = 2
    Me.txLast.Text = ""
    '
    'btCompute
    '
    Me.btCompute.Location = New System.Drawing.Point(24, 200)
    Me.btCompute.Name = "btCompute"
    Me.btCompute.Size = New System.Drawing.Size(80, 24)
    Me.btCompute.TabIndex = 5
    Me.btCompute.Text = "Compute"
    '
    'txName
    '
    Me.txName.Location = New System.Drawing.Point(32, 24)
    Me.txName.Name = "txName"
    Me.txName.Size = New System.Drawing.Size(208, 20)
    Me.txName.TabIndex = 0
    Me.txName.Text = ""
    '
    'btClear
    '
    Me.btClear.Location = New System.Drawing.Point(152, 200)
    Me.btClear.Name = "btClear"
    Me.btClear.Size = New System.Drawing.Size(72, 24)
    Me.btClear.TabIndex = 6
    Me.btClear.Text = "Clear"
    '
    'Form1
    '
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.ClientSize = New System.Drawing.Size(292, 273)
    Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btClear, Me.btCompute, Me.Label2, Me.Label1, Me.txLast, Me.txFirst, Me.txName})
    Me.Name = "Form1"
    Me.Text = "Name factory"
    Me.ResumeLayout(False)

  End Sub

#End Region

  Private Sub btCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btCompute.Click
    Dim nm As String
    Dim i As Integer
    nm = txName.Text
    Dim Nmer As NameClass
    Nmer = New NameFactory().getNamer(nm)

    txLast.Text = Nmer.getLast()
    txFirst.Text = Nmer.getFirst()

  End Sub

  Private Sub btClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btClear.Click
    txName.Text = ""
  End Sub
End Class
