By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,375 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,375 IT Pros & Developers. It's quick & easy.

"IF CONDITION" problem ...please hel P P P!!!

P: 3
I have this code at button click:
[VBCODE]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ListBox1.SelectedIndex() Then
Dim lines As String() = File.ReadAllLines(FileName, FileEncoding)
Dim Line As String = lines(Int(Rnd() * (UBound(lines) + 1)))
Dim Pos As Long = Line.IndexOf(" ")
TextBox1.Text = Line.Substring(0, Pos)
TextBox2.Text = Line.Substring(Pos + 1, Line.Length - Pos - 1)
End If
End Sub
End Class
[/VBCODE]
which take words and set them in 2 textboxes,
I need that with the click on the button one word will still enter the textbox1 (thats o.k in that code), the user at that point will enter a word in textbox2 , and the program will check if he enters the correct word with the value of textbox2 (as is it in the code) , and shows msgbox as right or wrong,..
can anyone help me please with this thing, I've tried a lot of situations but when I push the button it generate the next 2 words into the textboxes , and don't considerate the entered value.. :confused:
it supposed to be a very simple "if condition" .
Aug 14 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.