简体   繁体   English

如何指定可以使用C#在文本框中进行书写的书写对象(键盘/条形码扫描仪)?

[英]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): 我可以从设备管理器中看到它们(1.一个是条形码扫描器): 在此处输入图片说明

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. 我不知道该怎么做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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