Click here to Skip to main content
13,097,673 members (55,915 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I know how to restrict the users in entering character of English language as it is the first time that i am developing an student application in nonenglish language, therefor it would be your kind to answer my question. thanks
Posted 13-Nov-12 23:17pm
Updated 16-Nov-12 19:16pm
Rob@Love2Code 14-Nov-12 6:30am
I know this might sound a little strange, but being a dual language speaker, sometimes I don't know the word in my other language, and thereby use the English word. (I believe people refer to this as Double Dutch)
Perhaps restricting the allowed characters is not a good idea?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Niamatullah habibi 19-Nov-12 23:59pm
As i mentioned that i am using 2010 and i have a window application, it is going to be used in Arabic language and as well as in English language for English language i have done the validation rule like below is my code. what is my problem is that i want to do the same validation rule for Arabic language that the user may not be able to write numeric value in textbox where only text is allowed and viceversa text should not be written in the textbox where only numeric value is allowed to be thanks.

Private Sub txtTrnCnt_Name_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtTrnCnt_Name.KeyPress
If (Microsoft.VisualBasic.Asc(e.KeyChar) < 65) _
Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 90) _
And (Microsoft.VisualBasic.Asc(e.KeyChar) < 97) _
Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 122) Then
'Allowed space
If (Microsoft.VisualBasic.Asc(e.KeyChar) <> 32) Then
e.Handled = True
End If
End If
' Allowed backspace
If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then
e.Handled = False
End If
End Sub
Jacques Loubser 20-Nov-12 1:23am
Try using the Unicode codes to validate the input. Look at Wikipeadia for the unicode ranges. You will have to work out what is Letters and what is numbers.
Have you thought of a virtual keyboard with the letters only typing in the letters box and visa versa?
kareemakrm 5-Feb-16 4:44am
i want to allow arbic char in textbox with
Jacques Loubser 21-Nov-12 6:25am
Just Validate the Arabic in Unicode. Keep the ASCII for the English
Niamatullah habibi 23-Nov-12 2:43am
Dear all as i am new in, i need your help, please any body can to write the events to validate the user for writing in the textbox only Arabic characters, it would be your kind. thanks in advance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 17 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100