I have a small problem with my application. I have a new product adding dialog window. There's a barcode textbox on the form. And two buttons - "Cancel" with Cancel property True and "Save" with Default property True.
Now if I'm making my barcode textbox active and scanning barcode with barcode scanner it adds newline character in the end of the barcode. And there's the problem - it submits the form automatically, because "Save" button accepts ENTER as a submit key.
How can I avoid that scanning barcode and there's newline character at the end, that it does not affect form's default button?
Thanks in advance!
A barcode scanner, in its simplest form, appears to the OS as just another keyboard. Since you want to ignore when the barcode scanner sends the signal for Enter, but you want to accept it when the user presses the same key on the "real" keyboard, you'll need to distinguish between multiple keyboards.