<i id='XnrZ8'><tr id='XnrZ8'><dt id='XnrZ8'><q id='XnrZ8'><span id='XnrZ8'><b id='XnrZ8'><form id='XnrZ8'><ins id='XnrZ8'></ins><ul id='XnrZ8'></ul><sub id='XnrZ8'></sub></form><legend id='XnrZ8'></legend><bdo id='XnrZ8'><pre id='XnrZ8'><center id='XnrZ8'></center></pre></bdo></b><th id='XnrZ8'></th></span></q></dt></tr></i><div id='XnrZ8'><tfoot id='XnrZ8'></tfoot><dl id='XnrZ8'><fieldset id='XnrZ8'></fieldset></dl></div>

      <small id='XnrZ8'></small><noframes id='XnrZ8'>

      <legend id='XnrZ8'><style id='XnrZ8'><dir id='XnrZ8'><q id='XnrZ8'></q></dir></style></legend>
        <bdo id='XnrZ8'></bdo><ul id='XnrZ8'></ul>
      <tfoot id='XnrZ8'></tfoot>
    1. 如何更改 wpf 中的语言文本框?

      时间:2023-06-09

          <tbody id='Q6tjH'></tbody>
      1. <tfoot id='Q6tjH'></tfoot>

            <legend id='Q6tjH'><style id='Q6tjH'><dir id='Q6tjH'><q id='Q6tjH'></q></dir></style></legend>

              <bdo id='Q6tjH'></bdo><ul id='Q6tjH'></ul>

                <small id='Q6tjH'></small><noframes id='Q6tjH'>

              • <i id='Q6tjH'><tr id='Q6tjH'><dt id='Q6tjH'><q id='Q6tjH'><span id='Q6tjH'><b id='Q6tjH'><form id='Q6tjH'><ins id='Q6tjH'></ins><ul id='Q6tjH'></ul><sub id='Q6tjH'></sub></form><legend id='Q6tjH'></legend><bdo id='Q6tjH'><pre id='Q6tjH'><center id='Q6tjH'></center></pre></bdo></b><th id='Q6tjH'></th></span></q></dt></tr></i><div id='Q6tjH'><tfoot id='Q6tjH'></tfoot><dl id='Q6tjH'><fieldset id='Q6tjH'></fieldset></dl></div>
              • 本文介绍了如何更改 wpf 中的语言文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我是 WPF 新手.

                我正在尝试更改文本框内的语言,在窗口窗体中,我正在使用此代码.

                I'm trying to change the language within the text box when writing inside, In a window form i was using this code.

                System.Globalization.CultureInfo TypeOfLanguage = new System.Globalization.CultureInfo("en-us");
                InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(TypeOfLanguage);
                

                我不知道如何更改语言的问题因为代码在 WPF 中不起作用.

                The problem I do not know how I will be able to change the language Because the code does not work in WPF.

                请帮助我如何更改输入语言?

                Please help me How i can change the input language ?

                推荐答案

                为了完成你必须使用 InputLanguageManager 类

                In order to acomplish that you have to use InputLanguageManager Class

                this.Dispatcher.Thread.CurrentCulture.Name.ToString();
                InputLanguageManager.SetInputLanguage(myTextBox, CultureInfo.CreateSpecificCulture("fr"));
                tb2.Text = "Available Input Languages:";
                lb1.ItemsSource = InputLanguageManager.Current.AvailableInputLanguages;
                tb3.Text = "Input Language of myTextBox is " + InputLanguageManager.GetInputLanguage(myTextBox).ToString();
                tb4.Text = "CurrentCulture is Set to " + this.Dispatcher.Thread.CurrentCulture.Name.ToString();
                

                注意:链接上方的代码粘贴表单...

                Note: Code pasted form above link...

                这篇关于如何更改 wpf 中的语言文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:在 C# 中使用按钮清除多个文本框 下一篇:如何绑定到 CaretIndex 又名文本框的光标位置

                相关文章

                <i id='EAy2S'><tr id='EAy2S'><dt id='EAy2S'><q id='EAy2S'><span id='EAy2S'><b id='EAy2S'><form id='EAy2S'><ins id='EAy2S'></ins><ul id='EAy2S'></ul><sub id='EAy2S'></sub></form><legend id='EAy2S'></legend><bdo id='EAy2S'><pre id='EAy2S'><center id='EAy2S'></center></pre></bdo></b><th id='EAy2S'></th></span></q></dt></tr></i><div id='EAy2S'><tfoot id='EAy2S'></tfoot><dl id='EAy2S'><fieldset id='EAy2S'></fieldset></dl></div>

                  1. <tfoot id='EAy2S'></tfoot>
                      <bdo id='EAy2S'></bdo><ul id='EAy2S'></ul>
                  2. <small id='EAy2S'></small><noframes id='EAy2S'>

                  3. <legend id='EAy2S'><style id='EAy2S'><dir id='EAy2S'><q id='EAy2S'></q></dir></style></legend>