title: C# How to auto okay from RFID scanning?
body: <p>I have a program wherein the user taps an RFID card on a reader and the program will input this data. In this program, there is a prompt wherein I have to click OK. How do I remove the OK button and make it an auto-OK program once the RFID card is tapped?</p>
  
  <p>Here are the parts of the program:</p>
  
  <p>delegate void Function();</p>
  
  <pre><code>    private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
      {
          string sdsd = serialPort1.ReadLine();
          string Hexed = new LasalleRFIDComputerRentals.BLL.DAL.Utils().HexIt(sdsd);
  
          SetRFIDText(Hexed);
      }
  
  
      protected void SetRFIDText(string input)
      {
          this.Invoke(new Function(delegate()
          {
              txtRFID.Text = input;
          }));
  
          CustomerInfo customer = new Customer().GetCustomerByRFID(txtRFID.Text);
  
  
      }
  
      private void btnOk_Click(object sender, EventArgs e)
      {
          if (txtRFID.Text.Trim() == "")
          {
              MessageBox.Show(this, "Please supply the RFID.", "RFID Reader", MessageBoxButtons.OK);
  
              txtRFID.Focus();
              return;
          }
  
          CustomerInfo customer = new Customer().GetCustomerByRFID(txtRFID.Text);
  
          if (customer.CustomerID &lt;= 0)
          {
              MessageBox.Show("Invalid RFID", "Validation");
  
              this.Close();
              return;
          }
  
  
          if (_parentForm == "StandBy")
          {
              Utils.CurrentCustomer.CustomerInfo = customer;
  
              frmStandBy form = (frmStandBy)this.Owner;
  
              form.xResult = "OK";
          }
  
          this.Close();
      }
  </code></pre>