当我扫描文本框中的条形码文本时,不会触发TextChangeEvent? [英] TextChangeEvent is not fired when i scan the barcode text in my textbox?

查看:62
本文介绍了当我扫描文本框中的条形码文本时,不会触发TextChangeEvent?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过我的usb连接的条形码机器扫描条形码时,我想在gridview中显示细节。当我在文本框中获取条形码文本时,我的Textchange事件没有被触发。这就是我所做的远。



< asp:TextBox ID =TextBox1runat =serverAutoPostBack =Trueontextchanged =TextBox1_TextChanged

>



 受保护  void  TextBox1_TextChanged( object  sender,EventArgs e)
{

string voucher = TextBox1.Text;

}







任何帮助都将受到赞赏。

解决方案

您没有触发某个事件。您只需向扫描仪显示条形码即可完成工作。



根据条形码扫描仪所显示的接口(可能是串行端口),您最终会阅读来自界面的条形码,并对数据进行任何操作。



请查阅条形码扫描器上的文档,了解它是如何暴露给您的代码的。

I want to display the detail in gridview when i scan a barcode through a barcode machine which is connected through my usb.My Textchange event is not getting fired when i get the barcode text in textbox.This is what i have done so far.

<asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True" ontextchanged="TextBox1_TextChanged"
>

protected void TextBox1_TextChanged(object sender, EventArgs e)
{

    string voucher = TextBox1.Text;

}




Any help would be appreciated.

解决方案

You don't "trigger" an event. You simply show the scanner the barcode and it does the work.

Depending on the interface your barcode scanner is exposed on, probably as a serial port, you end up reading the barcode from the interface and do whatever you need to do with the data.

Consult the documentation on the barcode scanner to see how it's exposed to your code.


这篇关于当我扫描文本框中的条形码文本时,不会触发TextChangeEvent?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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