private void ProcessScannedText() { var card = new MagneticStripeScan(ScannedText); ScannedText = string.Empty; if (card.Valid) { Card = card; DialogResult = DialogResult.OK; } else { lblBadRead.Visible = true; new Thread(new ThreadStart(() => { Thread.Sleep(1000); lblBadRead.Invoke((MethodInvoker) delegate() { lblBadRead.Visible = false; }); })).Start(); } }
private void btnUseCard_Click(object sender, EventArgs e) { if (!IsManual) { return; } Card = new MagneticStripeScan((string)TxtCCNumber.Tag, CmbCCMonth.SelectedItem.ToString(), CmbCCYear.SelectedItem.ToString().Substring(2, 2)); if (Card.Valid) { DialogResult = DialogResult.OK; } else { TxtCCNumber.Text = ""; TxtCCNumber.Tag = string.Empty; lblBadRead.Visible = true; new Thread(new ThreadStart(() => { Thread.Sleep(1000); lblBadRead.Invoke((MethodInvoker) delegate() { lblBadRead.Visible = false; }); })).Start(); } }