Home > DeveloperSection > Forums > Make ElseIf Statement Check Strings
Simons Hood
Simons Hood

Total Post:70

Posted on    June-11-2013 7:39 AM

 VB.Net VB.Net 

 1 Reply(s)
 1100  View(s)
Rate this:

How to check textbox equals to the string in My.Settings.Something  in VB.NET?

Thanks in advance. 


Total Post:604

Posted on    June-12-2013 7:49 AM

Hi Samuel,

You can used If Else statement for checking Strings

    If My.Settings.Something <> TextboxName.Text Then 
        // to do if...
    ElseIf My.Settings.Something = TextboxName.Text Then 
        // to do else if...
    ElseIf My.Settings.Something = 999 Then 
        // to do else if...
        // to do else... 
    End If

Depending on variable types you using in the settings you might need to use My.Settings.Something.ToString() instead of My.Settings.Something Additionally, it might be needed to first store the variable from the textbox into a variable of the right type.

   Dim dblVar as Double
   dblVar = TextBoxName.Text

Don't want to miss updates? Please click the below button!

Follow MindStick