Sorry for the long title, but I couldn\'t think of another way to put it.
I have this:
private void textBoxToSubmit_KeyDown(object sender, KeyEventAr
If you want the return to trigger an action only when the user is in the textbox, you can assign the desired button the AcceptButton control, like this.
private void textBox_Enter(object sender, EventArgs e)
{
ActiveForm.AcceptButton = Button1; // Button1 will be 'clicked' when user presses return
}
private void textBox_Leave(object sender, EventArgs e)
{
ActiveForm.AcceptButton = null; // remove "return" button behavior
}