解决.Net中文输入BUG
WinForm程序有的时候会遇到无法切换到中文输入的BUG 解决办法如下: 在Form的构造函数中将ImeMode修改为ImeMode.OnHalf public Form1() { InitializeComponent(); ImeMode = ImeMode.OnHalf; } 另外针对DataGridView还需要特殊处理 在事件EditingControlShowing中将Control的ImeMode设置为ImeMode.OnHalf private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if (e.Control == null) return; e.Control.ImeMode = ImeMode.OnHalf; } 这样默认打开的时候所有的输入法都是中文半角的了。查看完整版本: 解决.Net中文输入BUG
Tags: