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 lstFriends As System.Windows.Forms.ListBox
    Friend WithEvents btnGo 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.btnGo = New System.Windows.Forms.Button()
        Me.lstFriends = New System.Windows.Forms.ListBox()
        Me.SuspendLayout()
        '
        'btnGo
        '
        Me.btnGo.Location = New System.Drawing.Point(176, 16)
        Me.btnGo.Name = "btnGo"
        Me.btnGo.Size = New System.Drawing.Size(96, 32)
        Me.btnGo.TabIndex = 1
        Me.btnGo.Text = "Go"
        '
        'lstFriends
        '
        Me.lstFriends.IntegralHeight = False
        Me.lstFriends.Location = New System.Drawing.Point(8, 16)
        Me.lstFriends.Name = "lstFriends"
        Me.lstFriends.Size = New System.Drawing.Size(152, 184)
        Me.lstFriends.TabIndex = 0
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(288, 213)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnGo, Me.lstFriends})
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click

        ' define an array to hold friends in...
        Dim friends() As String = {"Darren", "Edward", "Alex", _
            "Charlotte", "Len"}

        ' make friends bigger!
        ReDim friends(6)
        friends(5) = "Zoe"
        friends(6) = "Faye"


        ' show the friends...
        AddFriendsToList(friends)



    End Sub
    Sub AddFriendsToList(ByVal friends() As String)

        ' add each friend...
        Dim friendName As String
        For Each friendName In friends

            ' add it...
            lstFriends.Items.Add("[" & friendName & "]")

        Next




    End Sub




End Class
