我有 2 个 groupBoxes,都有一个 TextBox 和一个 Button。
当我在 groupBox1 中并在 textBox1 中写一些东西并按下 Enter 按钮时,应该按下 groupBox1 中的按钮,当我在 groupBox2 中并在 textBox2 中写一些东西时也是如此。
就像是
if (Focus is on groupbox1 == true)
this.AcceptButton = button1;
else if(Focus is on groupbox2 == true)
this.AcceptButton = button2;