I have a application which runs on WT41N0. This application has a form which accepts the label scanned by the scanner in a textbox on keyDown event.
private void txtBarCode_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return)
{
string lstrBarCodeID = txtBarCode.Text.Trim();
}
}
The problem is when I have a messagebox on the screen waiting for user input (Yes/No) and someone scans a barcode, the application takes action on the messagebox. This happens because the barcode scanner has a 'ENTER' (carriage return) symbol set at the end, which is being held in the input stream and 'fired' when I open a message box leading to the closure of MessageBox.
I want the application not to scan or scan but don't let the message box go disappear as a result. When user is using the application without looking at the screen, they keep on scanning without realizing that there is a message on the screen and keep scanning leading to issues with the operations. I just want to stop the application to perform any action until the user takes a action on the message on the screen.
I might be missing a trick as I am new to front-end programming with C#.