Public Class Form1 Dim points As Integer Dim questions(6) As q Dim textboxes(6) As TextBox Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim resFile As IO.StreamReader Dim Row As String Dim line As Integer resFile = New IO.StreamReader("Autos.txt") Do line = line + 1 If resFile.EndOfStream Then Exit Do Row = resFile.ReadLine Me.AddQ(line, Row) Loop resFile.Close() End Sub Public Sub AddQ(ByVal line As Integer, ByVal Row As String) Dim objLabel As Label Dim objText As TextBox Dim arrData(8) As String Dim question As q 'MsgBox(Row) arrData = Row.Split("|") 'Me.questions(line).text = arrData(1) question = New q question.text = arrData(0) question.intSolution = arrData(1) Dim i As Integer While (i + 2 < arrData.Length) question.answers(i) = arrData(i + 2) i = i + 1 End While Me.questions(line) = question objLabel = New Label objLabel.Text = arrData(0) objLabel.Top = 10 + (line - 1) * 100 objLabel.Left = 20 objLabel.Height = 15 objLabel.Parent = Me objLabel.ForeColor = Color.Blue objLabel.Tag = line objText = New TextBox objText.Top = 5 + (line - 1) * 100 objText.Left = objLabel.Right objText.Parent = Me Me.textboxes(line) = objText AddHandler objLabel.Click, AddressOf Labelx_Click End Sub Public Sub Labelx_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Dim objList As ListBox 'MsgBox(ActiveControl.Text) 'MsgBox(sender.tag) Me.textboxes(sender.tag).Visible = False objList = New ListBox objList.Top = 100 * (sender.tag - 1) + 30 objList.Parent = Me objList.Height = 50 objList.Left = 20 Dim i As Integer While (i < 3) objList.Items.Add(Me.questions(sender.tag).answers(i)) i = i + 1 End While 'Me.textboxes(ActiveControl.Tag).Visible = False End Sub End Class Class q Public text As String Public answers(3) As String Public intSolution As Integer End Class