vendredi 2 juin 2017

Visual Basic Or, OrElse still returning false

I am new to VB.net and i have little problem with this statement, i want to throw msgBox just if in txtBox txtTitul is not "Bc." or "" or "Ing." ... and this is throwing msgBox everytime

If Not txtTitul.Text.Equals("Bc.") OrElse Not txtTitul.Text.Equals("") OrElse Not txtTitul.Text.Equals("Bc.") OrElse Not txtTitul.Text.Equals("Mgr.") OrElse Not txtTitul.Text.Equals("Ing.") OrElse Not txtTitul.Text.Equals("Mgr. art.") OrElse Not txtTitul.Text.Equals("Ing. arch.") OrElse Not txtTitul.Text.Equals("MUDr.") OrElse Not txtTitul.Text.Equals("MVDr.") OrElse Not txtTitul.Text.Equals("RNDr.") OrElse Not txtTitul.Text.Equals("PharmDr.") OrElse Not txtTitul.Text.Equals("PhDr.") OrElse Not txtTitul.Text.Equals("JUDr.") OrElse Not txtTitul.Text.Equals("PaedDr.") OrElse Not txtTitul.Text.Equals("ThDr.") Then
        MsgBox("Neplatny titul!")
        Exit Sub
    End If

Aucun commentaire:

Enregistrer un commentaire