Make ElseIf Statement Check Strings

Total Post:70

Points:494
VB.Net 
 1378  View(s)
Ratings:
Rate this:
Hi,

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

Thanks in advance. 


  1. Post:604

    Points:4228
    Re: Make ElseIf Statement Check Strings

    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...
        Else
            // 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

      Modified On Mar-30-2018 02:14:51 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!