Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42466

Ignoring 1s and 0s in a TextBox

$
0
0
I'm new to Visual Basic express 2010 and I'm trying to figure out a tiny code to get my TextBox to ignore 1s and 0s and clear the TextBox.
This is what I have currently :

Code:

If (txtPhoneNumber.Text) = ("1") Or ("0") Then
                    txtPhoneNumber.Text = ""
                    MessageBox.Show("Phone Numbers Must Not Contain 1s or 0s!", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                End If

The current code doesn't work at all so I'm looking for something that will.

Thank you in advance for looking!

Viewing all articles
Browse latest Browse all 42466

Latest Images

Trending Articles



Latest Images