次の方法で共有


Detect user writing system in run-time

As you know, some languages use left-to-right writing system and some – right-to-left. It is good pattern (and besides so easy in .NET Framework) to make other users to feel comfortable using your App even if no other localization is planned.

Here is how to detect current writing system:

 if (System.Globalization.CultureInfo.CurrentCulture.TextInfo.IsRightToLeft)
    MessageBox.Show("This is Right-to-Left Writing system.");
 else
     MessageBox.Show("This is Left-to-Right Writing system.");
 

You can easily adopt your App to work with any system dynamically if you put this snippet to each of your form's Form_Load event:

 this.RightToLeft = System.Globalization.CultureInfo.CurrentCulture.TextInfo.IsRightToLeft ?
    RightToLeft.Yes : RightToLeft.No;
 

Technorati Tags: Globalization,C#,CultureInfo

Comments