WPF:对TextBox关闭输入法

方法一:
增加命名空间:xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"
在XAML文件中增加TextBox的附加属性:input:InputMethod.IsInputMethodEnabled="False"

方法二:
调用 System.Windows.Input.InputMethod.SetIsInputMethodEnabled 方法

public static void SetIsInputMethodEnabled(DependencyObject target, bool value)

Comments are closed.