Beispiel #1
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            RichText.Focus();

            if (!InputLanguageManager.Current.CurrentInputLanguage.EnglishName.Contains("English"))
            {
                var original = System.Windows.Forms.InputLanguage.CurrentInputLanguage;
                var language = System.Windows.Forms.InputLanguage.FromCulture(CultureInfo.GetCultureInfo("en-us"));
                if (System.Windows.Forms.InputLanguage.InstalledInputLanguages.IndexOf(language) >= 0)
                {
                    System.Windows.Forms.InputLanguage.CurrentInputLanguage = language;
                }
                else
                {
                    System.Windows.Forms.InputLanguage.CurrentInputLanguage =
                        System.Windows.Forms.InputLanguage.DefaultInputLanguage;
                }
            }
        }