I suggest to trap it when user input the characters.
So, users can only input the specific characters.
Example : (This text box only accept numbers input only)
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
End
If Asc(e.KeyChar) = 8 Then
e.Handled = False
End If
End Sub
Jx_Man
Senior Poster
3,527 posts since Nov 2007
Reputation Points: 1,482
Solved Threads: 516
Skill Endorsements: 64
If TextBox1.Text.Contains("$1$") and TextBox1.Text.Contains("abcdefg") and Len(TextBox1.Text) = 32 then
MsgBox("hit")
End If
Reverend Jim
Carpe per diem
3,596 posts since Aug 2010
Reputation Points: 561
Solved Threads: 446
Skill Endorsements: 32
Question Answered as of 1 Year Ago by
Jx_Man
and
Reverend Jim