Reputation: 3
If result12.Contains("""Status"" value=""0""") Then
TextBox1.Text = "Antique Lights are On" And
Label19.ForeColor = Color.Red
End If
I can not figure out what I'm doing wrong here. I just want the text box to show "Antique Lights are On". I keep getting an error about converting to Boolean. Shouldn't it stay string? I'm using Visual Studio 2013 and creating a windows form.
Upvotes: 0
Views: 2593
Reputation: 6558
The problem is this:
TextBox1.Text = "Antique Lights are On" And
Label19.ForeColor = Color.Red
Starting in VS 2012, you didn't have to include the underscore for a line continuation in VB.NET.
So this is interpreted as boolean statement:
"Antique Lights are On" And Label19.ForeColor = Color.Red
Since "Antique Lights are On"
isn't a valid boolean statement you get the error.
Upvotes: 3
Reputation: 1541
You do not need the 'And' to process the next line.
'And' in this case is trying to do a boolean conditional, which doesn't make sense in this context.
Upvotes: 0