Public Class blank_form Dim myLabels() As Label Dim myBoxes() As TextBox 'Dim myControls() As CheckBox Private Sub blank_form_Load(sender As Object, e As EventArgs) Handles MyBase.Load ' Set up the form With Me .Size = New System.Drawing.Size(300, 400) .Text = Start.formTitle .Location = New Point(300, 10) End With ' used to establish form control properties Dim xLeft As Integer = 10 Dim yTop As Integer = 10 Dim height As Integer = 20 Dim labelWidth As Integer = 100 Dim boxWidth As Integer = 150 Dim count As Integer = 0 Dim aLine As String Dim myReader As IO.StreamReader myReader = IO.File.OpenText(Start.fileName) aLine = myReader.ReadLine() 'first line has descriptive data Do Until myReader.EndOfStream count += 1 aLine = myReader.ReadLine ReDim Preserve myLabels(count) myLabels(count) = New Label myLabels(count).Location = New Point(xLeft, (count - 1) * height) myLabels(count).Text = aLine myLabels(count).Width = labelWidth ReDim Preserve myBoxes(count) myBoxes(count) = New TextBox myBoxes(count).Location = New Point(xLeft + labelWidth + 5, (count - 1) * height - 2) myBoxes(count).Width = labelWidth ' ReDim Preserve myControls(count) ' myControls(count) = New CheckBox ' myControls(count).Name = "chkBox" & count.ToString ' myControls(count).Left = xLeft ' myControls(count).Top = (count - 1) * height ' myControls(count).Text = aLine Me.Controls.Add(myLabels(count)) Me.Controls.Add(myBoxes(count)) ' Me.Controls.Add(myControls(count)) Loop 'Dim myButton As New Button 'myButton.Name = "btnShowChecked" 'myButton.Text = "Show checked boxes" ''myButton.Left = xLeft * 2 ''myButton.Top = (count + 1) * height 'myButton.Location = New Point(xLeft * 2, (count + 1) * height) 'AddHandler myButton.Click, AddressOf Me.Button_Click 'Me.Controls.Add(myButton) End Sub End Class Public Class BuildExample Public controlCount As Integer Dim hand() As PictureBox Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click start.lblMessage.Text = "Pretend I did it." Me.Close() End Sub Private Sub BuildExample_Load(sender As Object, e As EventArgs) Handles MyBase.Load MessageBox.Show("need to build " & controlCount.ToString & " controls") ReDim hand(controlCount) Dim xStart, yStart As Integer xStart = 10 yStart = 50 For i As Integer = 1 To controlCount hand(i) = New PictureBox '.......... set size & position of picture box hand(i).Width = 36 hand(i).Height = 45 hand(i).Location = New Point(xStart + 40 * (i - 1), yStart) hand(i).SizeMode = PictureBoxSizeMode.AutoSize '.......... add the picture to the form/window Me.Controls.Add(hand(i)) '.......... put a card in the picture box hand(i).Image = My.Resources.ResourceManager.GetObject("card" & i.ToString) Next hand(controlCount / 2).Image = My.Resources.ResourceManager.GetObject("card" & Fix(Rnd() * 52 + 1).ToString) End Sub End Class Public Class start Private Sub btnToSample_Click(sender As Object, e As EventArgs) Handles btnToSample.Click Dim newForm As New mySampleForm newForm.ShowDialog() 'mySampleForm.ShowDialog() End Sub Private Sub btnToBlank_Click(sender As Object, e As EventArgs) Handles btnToBlank.Click Dim count = InputBox("How many cards shall I display?") Dim formRef As New BuildExample formRef.controlCount = count formRef.ShowDialog() End Sub End Class in Start form On load * Read data from file to label buttons for various classes * Label each button On button click * use button text to get file name * store the file name in the new form * open the new form in the opened form on load * open the file (report problem if one exists and quit) * read the file creating name label (names()) and three check boxes (present(), tardy(), left())