Public Class frmArrayObjects
  Inherits System.Windows.Forms.Form
  Dim MyList As Integer() = New Integer(10) {}
  Dim MyCopy As Integer()

#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

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

  '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.
  Friend WithEvents txtList As System.Windows.Forms.TextBox
  Friend WithEvents btnCalc As System.Windows.Forms.Button
  Friend WithEvents btnExit As System.Windows.Forms.Button
  Friend WithEvents btnShow As System.Windows.Forms.Button
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.txtList = New System.Windows.Forms.TextBox()
    Me.btnCalc = New System.Windows.Forms.Button()
    Me.btnExit = New System.Windows.Forms.Button()
    Me.btnShow = New System.Windows.Forms.Button()
    Me.SuspendLayout()
    '
    'txtList
    '
    Me.txtList.Location = New System.Drawing.Point(8, 8)
    Me.txtList.Multiline = True
    Me.txtList.Name = "txtList"
    Me.txtList.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
    Me.txtList.Size = New System.Drawing.Size(136, 160)
    Me.txtList.TabIndex = 0
    Me.txtList.Text = "txtList"
    '
    'btnCalc
    '
    Me.btnCalc.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.btnCalc.Location = New System.Drawing.Point(152, 8)
    Me.btnCalc.Name = "btnCalc"
    Me.btnCalc.Size = New System.Drawing.Size(96, 23)
    Me.btnCalc.TabIndex = 1
    Me.btnCalc.Text = "&Calculate"
    '
    'btnExit
    '
    Me.btnExit.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.btnExit.Location = New System.Drawing.Point(152, 144)
    Me.btnExit.Name = "btnExit"
    Me.btnExit.Size = New System.Drawing.Size(96, 23)
    Me.btnExit.TabIndex = 2
    Me.btnExit.Text = "E&xit"
    '
    'btnShow
    '
    Me.btnShow.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.btnShow.Location = New System.Drawing.Point(152, 40)
    Me.btnShow.Name = "btnShow"
    Me.btnShow.Size = New System.Drawing.Size(96, 23)
    Me.btnShow.TabIndex = 3
    Me.btnShow.Text = "&Show"
    Me.btnShow.Visible = False
    '
    'frmArrayObjects
    '
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.ClientSize = New System.Drawing.Size(256, 181)
    Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnShow, Me.btnExit, Me.btnCalc, Me.txtList})
    Me.Name = "frmArrayObjects"
    Me.Text = "Array Objects"
    Me.ResumeLayout(False)

  End Sub

#End Region

  Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
    Dim i As Integer

    txtList.Clear()

    For i = 0 To 10
      MyList(i) = i     ' Just fill in some values
    Next i

    MyCopy = MyList

    For i = 0 To 10
      txtList.Text &= MyCopy(i) & vbCrLf
    Next
    btnShow.Visible = True

  End Sub

  Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
    Me.Dispose()
  End Sub

  Private Sub frmArrayObjects_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

  End Sub

  Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShow.Click
    Dim i As Integer

    MyCopy(5) = 52443   ' Set a new value for copy

    txtList.Clear()     ' Clear the old data

    For i = 0 To 10     ' Now show ORIGINAL list!
      txtList.Text &= MyList(i) & vbCrLf
    Next

  End Sub
End Class
