i am working with a winform application , and in the richbox_textchange i would like to detect whether the entered text is English or not because if it is english i`ll perform LeftToRight typing else RightToLeft typing .
I used that code :
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
if (CultureInfo.CurrentCulture.TextInfo.IsRightToLeft)
{
label1.Text = "RTL";
}
else
{
label1.Text = "LTR";
}
}
but i always get : LTR only , label1 never change text to RTL even if i typed arabic !!!
EDIT : ANSWERED !!
Firstly Thanks to everybody for helping me here and especially Oded , here is the solution i could figure out
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
if (InputLanguage.CurrentInputLanguage.Culture.TextInfo.IsRightToLeft)
{
label1.Text = "RTL";
}
else
{
label1.Text = "LTR";
}
}