06-10-19, 12:38 PM
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
06-10-19, 03:42 PM
(06-10-19, 02:46 PM)Rabeea Qbaha كتب : [ -> ]في حدث ال 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
اخي الكريم شكرا لك ارسلت ثلاثة اكواد اثنان منهم تجعل التكست لايدخل به إلا ارقم والثالث لايكتب الا اللغة العربية
لكن لم ترسل لم اجد منع كتابة الارقام
(06-10-19, 03:42 PM)المنذر كتب : [ -> ](06-10-19, 02:46 PM)Rabeea Qbaha كتب : [ -> ]في حدث ال 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
اخي الكريم شكرا لك ارسلت ثلاثة اكواد اثنان منهم تجعل التكست لايدخل به إلا ارقم والثالث لايكتب الا اللغة العربية
لكن لم ترسل لم اجد منع كتابة الارقام
عفوا اخي احد الاكواد لايقبل الا ادخال اللغة الانكليزية والاثنين الاخرين يمنعان ادخال الاحرف
اريد منع ادخال الارقم وقبول الاحرف فقط
06-10-19, 04:27 PM
06-10-19, 04:34 PM
كود :
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 كود :
Dim allowedChars As String = "abcdefghijklmnopqrstuvwxyz"
06-10-19, 04:44 PM
(06-10-19, 04:34 PM)Rabeea Qbaha كتب : [ -> ]كود :
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 كود :
Dim allowedChars As String = "abcdefghijklmnopqrstuvwxyz"
شكرا اخي كثير كله تمام وفقك الله