日期:2014-05-18 浏览次数:20776 次
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar != '\r') e.Handled = true; }
------解决方案--------------------
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar != (char)Keys.Return) e.Handled = true; }
------解决方案--------------------
private void rtbtxt_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyValue != 13)
{
retrun;
}
}
点击键盘。除了回车其余都屏蔽。
------解决方案--------------------
private void rtbtxt_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyValue != 13)
{
retrun;
}
}
点击键盘。除了回车其余都屏蔽。
------解决方案--------------------
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Return) ; //处理响应回车的代码 else e.Handled = false; }
------解决方案--------------------