private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
char lastChar = e.KeyChar;
//MessageBox.Show(((int)e.KeyChar).ToString());
if (e.KeyChar != 32 && e.KeyChar !=8) //allows space and backspace
{
if (char.IsControl(lastChar) || char.IsDigit(lastChar) || char.IsNumber(lastChar) || char.IsPunctuation(lastChar))
e.Handled = true;
else if (lastChar < 1569)//the start of ascii codes for Arabic chars.
e.Handled = true;
}
}

I consider Arabic caligraphy one of the most beautiful in the world. I even can distinguish some letters in it, although I do not understand Arab, exept for some words like "salaam" etc.
I think you are helping lots of people with your snippet.

Danny, you don't imagine how much I miss you... Welcome back...
I love Arabic, that's why I did this as code snippet to help who want to deal with it, and for sure I'll be happy to find lots of questions about it.
"salaam" or "salam" == greeting words == "Hey, Hello, or bye bye" the origin "Al Salam" == some name of Allah -our God in Islam-
"Salaam" said instead of "Al Salam Alikom" == Peace be upon you.

What I wrote in the TextBox == I love Arabic language :)

Dear Ramy Mahrous, I have a problem with typing Arabic text (for Urdu Language) in Textbox. whenever i type arabic text the writing order switches to right to left. but when some non arabic character like space, brackets etc in the textbox the cursor jumps to right most position. can you please help me out. I am doing it in vb.net

The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.