1 Reply Latest reply on Jun 22, 2017 5:49 PM by Darryn Campbell

    How to turn on barcode scan reader?

    Lucio G Pazos

      Hi! I have this code on my zebra mk500 device and works fine when I turn on the scanner with other app, but the question are , how I turn on the scanner when my app start?

       

       

      private Symbol.Barcode.Reader MyReader = null;
      private Symbol.Barcode.ReaderData MyReaderData = null;

      private void Form1_Load(object sender, EventArgs e)
      {
        
      MyReader = new Symbol.Barcode.Reader();
        
      MyReaderData =
        
      new Symbol.Barcode.ReaderData(Symbol.Barcode.ReaderDataTypes.Text,
        
      Symbol.Barcode.ReaderDataLengths.DefaultText);
        
      MyReader.ReadNotify += new EventHandler(MyReader_ReadNotify);
        
      MyReader.Actions.Enable();
        
      MyReader.Actions.Read(MyReaderData);
        
      return;
      }

      private void Form1_Closing(object sender, CancelEventArgs e)
      {
        
      MyReader.Actions.Flush();
        
      MyReader.Actions.Disable();
        
      MyReader.Dispose();
        
      MyReaderData.Dispose();
        
      return;
      }

      private void MyReader_ReadNotify(object sender, EventArgs e)
      {
        
      System.Windows.Forms.MessageBox.Show(MyReaderData.Text, "HelloScan");
        
      MyReader.Actions.Read(MyReaderData);
        
      return;
      }