I have created a program that uses a Powerscan PD9530 scanner to register serialnumbers of different parts into a database. But one of the parts contains TAB between different parts of the serialnumber. I need to get the entire serialnumber into a selected TextBox, but the TABS in the QR-Code makes the focus jump to the next TextBox and presses some buttons as it jumps along.
My Program is able to identify what part is scanned to put it in the right location in the database.
The serialnumber format is like this: "+ 002761 M0610500HQ 000001917 " with the spaces being TAB
I have tried:
private void TxtPa_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Tab)
{
txtPa.Focus();
}
}
I was hoping that this would set the focus back to the TxtPa TextBox when the TAB space get input, but the next piece of numbers after the TAB gets put into the next TextBox instead.
I've managed to figure it out thanks to your help.
I added "e.Enabled = true" and it pretty much solved my initial problem.
I only had to declare the String that read from the TextBox outside the function
string OSRAM = "";
private void TxtPa_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Tab)
{
OSRAM = OSRAM + " " + txtPa.Text;
serl[5] = OSRAM;
e.Handled = true;
}
}
Thank you very much for the help