如何在visual basic中锁定文本框 [英] how to lock textbox in visual basic

查看:189
本文介绍了如何在visual basic中锁定文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我在 vb6中开发了一个应用程序该应用程序中,我已经 text 框控制 读取条形码。现在 text 用户可以输入任何 我想要的 如果 用户尝试 输入 text 框应用程序将忽略用户输入。只有条形码会在 text 框中扫描 。其他明智的 任何控制 < span class =code-keyword>只读条形码。

感谢 advance。

解决方案

你不能这样做。这种条形码扫描仪实现为键盘驱动器。这有时被称为键盘楔。或者,它可以像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


这篇关于如何在visual basic中锁定文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆