在OnKeyDown事件下寫入
if(e.KeyCode == Keys.Enter)
{
button1.Focus();
button1_Click(sender, e);
textBox1.Focus();
}
最後一行是把當前狀態回到textBox1的狀態,要保持在button1的狀態也是可以就不要寫那行
沒有留言:
張貼留言