I've created a stock locater/mover program. The scenario sequence is as follows:
- First, the user will scan a QR code into textBox1 and then scan a location into textBox2.
- Next, an update statement will execute resulting in 'moving' the stock's location.
How do I auto move the cursor into textBox2 after textBox1 has been populated with a QR Code?
Please note the QR codes vary in length. This prevents me from using textBox max length. I've currently tried the following:
private void textBox1_TextChanged(object sender, EventArgs e)
{
//part number textbox
var partNumber = textBox1.Text;
partNumber = partNumber.TrimEnd('\r', '\n');
if (textBox1.Text!=null)
{
textBox1.Select();
}
else
{
textBox2.Select();
}
}
Using the aforementioned code, the first character of the QR code is input into textBox1 and the remaining characters are input into textBox2. The desire is to have all the QR code characters in textBox1 and then have the cursor change focus to textBox2.