给TextBox控件加上KeyPress事件,事件代码如下:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if ((int)e.KeyChar >= 65296 && (int)e.KeyChar <= 65305) { e.KeyChar = (char)((int)e.KeyChar - 65248); } }
给TextBox控件加上KeyPress事件,事件代码如下:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if ((int)e.KeyChar >= 65296 && (int)e.KeyChar <= 65305) { e.KeyChar = (char)((int)e.KeyChar - 65248); } }