Solution
The barcode readers return not just the barcode data, but usually some prefix and sufix. A common part of the returned data is the termination character that in general is represented by a CR (0x0D), a LF (0x0A) or both, CR/LF (0x0D,0x0A). Some of the barcode readers can be even configure to have or not the termination character and which of the option above it would be.
If that's your case you can use the termination character as an edit mode exit for the string control as well as when you press the numeric keypad Enter button. To do so, first you need to configure the string control to allow just one line, so when it receives the terminal character instead of moving the cursor to the beginning of the line, it will exit the edit mode.
- Right-click the String control;
- Check "Limit to a single line" option.