Instead of attaching a PreviewKeyUp event with each TextBox in my app and checking if the pressed key was an Enter key and then do an action, I decided
PreviewKeyUp
TextBox
private void txtBarcode_KeyDown(object sender, KeyEventArgs e) { string etr = e.Key.ToString(); if (etr == "Return") { MessageBox.Show("You Press Enter"); } }