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

Visual Basic.Net Help Please

P: 4
How to check textbox inputs
--------------------------------------------------------------------------------

Hi I relatively new to VB.Net. And I have to create a sort of quiz type application.
There are a few Text boxes where the user will input their answers. I want the code to check the users input and compare with set answer. If correct add 1 to a total and at the end display the total correct answers. I have a code but I keep getting Errors like cannot convert boolean to integer etc. Any help please..

this is my code at the moment what is wrong?

Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click
Dim TotalAns As Integer
Dim txt As Boolean

Select Case txt
Case txtRep1.Text = "A"
TotalAns += 1
Case txtRep2.Text = "B"
TotalAns += 1
End Select
txtResults.Text = Str(TotalAns)
End Sub
End Class
Mar 27 '07 #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.