且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在visual basic中锁定文本框

更新时间:2022-12-20 09:08:42

你不能这样做。这种条形码扫描仪实现为键盘驱动器。这有时被称为键盘楔。或者,它可以像USB键盘一样工作。请参阅: http://en.wikipedia.org/wiki/Barcode_scanner#Keyboard_wedges [ ^ ]。



从技术上讲,这只是一个键盘。在我看来,这种方法非常难看,但是这个东西的开发是为了提供对这类硬件的访问,即使对于最糟糕的程序员也是如此。 :-)



现在,如果您以某种方式禁用聚焦控制,扫描仪将在其他地方键入。据我所知,没有一种记录方式可以让应用程序告诉来自另一个键盘的事件来自另一个键盘。



-SA

hello there

         i had develop a application in vb6. In that application i had take a text box control for read a barcode. Now in that text box  user can enter any values what i want i want to if user trying to entering in text box application will ignore user input. Only barcode will scan on that text box. Other wise is there any control to read only barcode.

Thanks in advance.

You cannot do it this way. This kind of barcode scanner is implemented as a keyboard driver. This is sometimes called "keyboard wedge". Or, it could behave as the USB keyboard. Please see: http://en.wikipedia.org/wiki/Barcode_scanner#Keyboard_wedges[^].

Technically, this is just a keyboard. In my opinion, such approach is quite ugly, but this thing was develop to provide access to this kind of hardware even to the lousiest programmers. :-)

Now, if you disable your focused control somehow, the scanner will "type" somewhere else. To best of my knowledge, there is no a documented way for an application to tell events coming from one keyboard from another one.

—SA