HELP! 'then' error?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am making a web browser, and have accidentaly posed this question to the
wrong newsgroup. I have a block in my code which is this:

If TextBox1 = < Then
WebBrowser1.GoBack()
End If

The response that I got from the other newsgroup was that I was stating that
TextBox1 had to be smaller than 'then'. I now realise this, but I want to
know how to get the code to state that if TextBox1 equals the '<' character
on the keyboard then to do xyz.

Please HELP
 
SmartRoss said:
I am making a web browser, and have accidentaly posed this question to the
wrong newsgroup. I have a block in my code which is this:

If TextBox1 = < Then
WebBrowser1.GoBack()
End If

The response that I got from the other newsgroup was that I was stating that
TextBox1 had to be smaller than 'then'. I now realise this, but I want to
know how to get the code to state that if TextBox1 equals the '<' character
on the keyboard then to do xyz.

Put quotes around the string literal:

If TextBox1 = "<" Then
 
Göran Andersson said:
Put quotes around the string literal:

If TextBox1 = "<" Then

Puting quotes around it causes an overload error, VB2005Express says that it
cannot find a valid '=' argument or something like that.
 
SmartRoss said:
Puting quotes around it causes an overload error, VB2005Express says that it
cannot find a valid '=' argument or something like that.

Please quote the exact error message when you get one. "Something like
that" could be just about anything...

Perhaps what you are trying to compare the string to is not a string at
all? Perhaps the TextBox1 variable is not a string, but a reference to a
TextBox control?
 
Back
Top