读取条形码值时调用函数 [英] Call a function when barcode value been read

查看:166
本文介绍了读取条形码值时调用函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
每当尝试从条形码读取器接收到的条形码值集中在文本框上时,我都试图调用一个函数.
我的意思是:我想读取条形码值而不关注特定的文本框,并且当读取值时,我想根据条形码的文本进行校准以填充文本框上的数据的函数.

我尝试过的事情:

我还没有尝试任何操作,等待建议

Hello,
I am trying to call a function whenever a barcode value received from barcode reader with out focus on textbox.
what I mean is : i want to read barcode value without focus on specific textbox and when value been read i want to do cal a function that fill data on textboxes according to the text of the barcode.

What I have tried:

i did not try anything yet, waiting for suggestion

推荐答案

除非您更改配置,否则大多数扫描仪都会设置为模拟键盘,并通过准确地输入数据来工作就像用户键入了它一样-这意味着它将进入具有输入焦点的任何控件.

要将其定向到特定的文本框,意味着您需要更改扫描仪以提供导入/导出代码,您的软件可以识别并正确设置焦点.

但是...您的操作方式取决于扫描仪的制造商(有时还取决于特定型号).因此,从文档开始,然后从制造商的网站开始,并了解如何添加可以使用的导入/导出代码.
Unless you change the configuration, most scanners arrive set up to emulate a keyboard, and work by feeding data in exactly as if the user had typed it - which means it goes into whatever control has the input focus.

To direct it to a particular textbox means that you need to change the scanner to provide lead in / lead out codes, which your software can recognise and set the focus appropriately.

But ... how you do that depends on the manufacturer (and sometimes the specific model) of the scanner. So start with the documentation, then the manufacturer website, and find out how to add lead in / lead out codes that you can work with.


这篇关于读取条形码值时调用函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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