Hi,
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.
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#.
Thanks!
What I have tried:
I tried a few things like:
1. Disable the text box that takes the barcode scanned and enable when the user has selected Yes or No.
txtBarCode.Enabled = false;
2. Used Symbol libraries and disable the scanner. (Even though I am not allowed to use these, so I have to find a solution without Symbol library)
private Symbol.Barcode.Reader myReader = null;
myReader = new Symbol.Barcode.Reader();
Then disable the scanner when the messagebox is displayed:
myReader.Actions.Disable();
Both these did not work. I do not want to use Symbol library though as this is not allowed in my organization.
Update:
I found that the barcode scanner has a 'carriage return' 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. Now, the question is how do I overcome this situation. When there is a message box or any Error being displayed on the screen the user should be forced to acknowledge the error message/message box first.