110,534
社区成员
发帖
与我相关
我的任务
分享
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (Char)Keys.Enter)
button1.PerformClick();
}
textBox2.KeyPress += textBox1_KeyPress; // 第2个
textBox3.KeyPress += textBox1_KeyPress; // 第3个
textBox4.KeyPress += textBox1_KeyPress; // 第4个
// 其实你也可以在属性对象器里直接事件页里下拉选择来设置