简体   繁体   中英

How to specify which writing object (keyboard/barcode scanner) can be used to write in textbox using C#?

my question is: How can I set which input "object" will be enabled for entering text into a textbox? My case is: I'm making a program where I need to use barcode scanner, and in one form in my program I want to constraint the user so he can only write down using barcode scanner. Any ideas how to implement that?

I can see both of them from device manager (1. one is barcode scanner): 在此处输入图片说明

A barcode scanner uses the keyboard interface of the computer: ie from the point of view of your textbox, it is just another keyboard.

If you want to force your user to use the barcode scanner instead of the "normal" keyboard, you have to somehow disable the normal keyboard in that situation. I do not know how to do that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM