I have a form where users scan in a barcode, the barcode reader automatically enters a carriage return in the value causing the form to submit since the browser chooses the
private void textbox1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) {
// do nothing
} }
this may help you