private void comboBoxInput_KeyPress(object sender, KeyPressEventArgs e) { e.KeyChar = char.ToUpper(e.KeyChar); if (!StringTool.IsLettersOrNum(e.KeyChar.ToString())) { MessageBox.Show(e.KeyChar.ToString() + " 非法字符!"); } }
private void comboBoxInput_KeyPress(object sender, KeyPressEventArgs e) { e.KeyChar = char.ToUpper(e.KeyChar); if (!StringTool.IsLettersOrNum(e.KeyChar.ToString())) { MessageBox.Show(e.KeyChar.ToString() + " 非法字符!"); } }