06-10-19, 02:46 PM
في حدث ال keypress :
كتابة الاحرف فقط :
او :
كتابة ارقام فقط:
كتابة الاحرف فقط :
PHP كود :
If System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "[^a-zA-Z0-9()\b]") Then
e.Handled = True
End If
PHP كود :
If Not (Asc(e.KeyChar) = 8) Then
Dim allowedChars As String = "abcdefghijklmnopqrstuvwxyz"
If Not allowedChars.Contains(e.KeyChar.ToString.ToLower) Then
e.KeyChar = ChrW(0)
e.Handled = True
End If
End If
كتابة ارقام فقط:
PHP كود :
If Asc(e.KeyChar) <> 8 Then
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
End If
End If
