I have a button and i want it to check for a condition to display different msgbox.
Below is my code:
Dim a As String = "";
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If ((a = "a") & (DetailsSelectedComment.Visible = True)) Then
MsgBox("Have")
Else
MsgBox("No have")
End If
End Sub
But i got the following error when i clicked on the button.
“Input string was not in a correct format. “
First remove the
";"from your code while declaring the variable"a"Dim a As String = "";toDim a As String = ""And for making and operations in VB.Net we should use AND and ANDALSO