[B]
HI ,I have this code:
the user choose item from the list (ex-"Colors") , and pressed button
the program generate a line from that text file which contains 2 word each like this file:

RED adom
Yellow zahov
white lavan
Green yarok
etc..

(the two words suppose to be with different languages).and displays the first word in textbox1, the user enter a word in textbox2 , and if it's the same as word2 it gives him a point.
THE CODE:

VB Code:
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         If ListBox1.SelectedIndex() Then
  3. Bk:         If TextBox2.Text = String.Empty Then
  4.                 Dim num As New Random
  5.                 Dim lines As String() = File.ReadAllLines("D:\Words\" & ListBox1.SelectedItem & ".txt", FileEncoding)
  6. nextrnd:        Dim Line As String = lines(Integer.Parse(num.Next(0, UBound(lines) + 1)))
  7.                 Dim Pos As Integer = Line.IndexOf(" ")
  8.                 Dim Spted = Split(Was, ",")
  9.                 If UBound(Spted) >= UBound(lines) + 1 Then
  10.                     Dim RightA = (Label9.Text / (Int(Label9.Text) + Int(Label10.Text)))
  11.                     Dim Grade = (RightA * 100)
  12.                     MsgBox("You Finished this test!" & vbCrLf & "Your Grade is: " & Int(Grade), MsgBoxStyle.Information, "Done!")
  13.                     Exit Sub
  14.                 End If
  15.                 If InStr(Was, "," & Line.Substring(0, Pos)) Then GoTo NextRnd
  16.                 TextBox1.Text = Line.Substring(0, Pos)
  17.                 strAnswer = Line.Substring(Pos + 1, Line.Length - Pos - 1)
  18.             Else
  19.                 If TextBox2.Text = strAnswer Then
  20.                     ''    MessageBox.Show("That is Correct!", "Correct", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  21.                     Label3.Text = "RIGHT!"
  22.                     Label3.ForeColor = Color.Green
  23.                     Label9.Text += 1
  24.                 Else
  25.                     ''  MessageBox.Show("I am Sorry, that answer is not correct!", "Incorrect", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  26.                     Label3.Text = "WRONG!"
  27.                     Label3.ForeColor = Color.Red
  28.                     Label10.Text += 1
  29.                 End If
  30.                 Label5.Text = TextBox1.Text
  31.                 Label4.Text = strAnswer
  32.                 Was &= "," & TextBox1.Text
  33.                 TextBox2.Text = String.Empty : GoTo Bk
  34.             End If
  35.  
  36.         End If
  37. END sub

there are two problems with this code:
1. if I press on an item (file) in the listbox and it contains 2 words
(ex-"light colors") , it doesn't generate the words into the textbox.
2.only one or two cells in the listbox function OK .. but item1 and 2 and even more aren't function.
PLEASE YOUR HELP ...