C# コンパクト フレームワーク 2.0 (windows mobile 6.1) の 2D リーダーを備えた Intermec ハンドヘルド デバイス CK30 用に開発しています。
バーコードを使用するたびに、キーボードが機能しなくなります。理由はありますか?
コードはこちら。最初のセクションは、バーコード リーダーを構成するクラスです。2 番目のセクションは、バーコード リーダーを使用してテキスト ボックスに入力するフォームです。
バーコードリーダーで何かを読み取った後、キーボードが機能しなくなります...
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Intermec.DataCollection;
namespace BarCodeReaderTest
{
class LeitorCodigoDeBarras
{
public BarcodeReader LerCodigoDeBarras()
{
try
{
BarcodeReader meuLeitor = new BarcodeReader("default", 4096);
meuLeitor.ScannerEnable = true;
meuLeitor.ThreadedRead(true);
return meuLeitor;
}
catch (BarcodeReaderException bx)
{
MessageBox.Show("Não foi possível inicializar o leitor de código de barras. Contate seu supervisor. \n" + bx.Message);
return null;
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Intermec.DataCollection;
namespace BarCodeReaderTest
{
public partial class Form1 : Form
{
public BarcodeReader leitor;
public Form1()
{
InitializeComponent();
LeitorCodigoDeBarras classeLeitor = new LeitorCodigoDeBarras();
leitor = classeLeitor.LerCodigoDeBarras();
leitor.BarcodeRead += new BarcodeReadEventHandler(this.eventoLeitorCodigoDeBarras);
}
void eventoLeitorCodigoDeBarras(object sender, BarcodeReadEventArgs e)
{
tbCodLido.Text = e.strDataBuffer;
}
}
}