private void Timer_Barcode_Tick(object sender, EventArgs e) { if (TextBox_Barcode.Text.Length > 0) { if (lastBarcodeTextBoxValue.Length == TextBox_Barcode.Text.Length) { string decodedBarcode = StringEncoder.ReturnDecryptedString(TextBox_Barcode.Text); if (decodedBarcode.Length > 0) { this.Hide(); ScanningUserDisplay scanningUserDisplay = new ScanningUserDisplay(this, mainWindow, participants, events, decodedBarcode); scanningUserDisplay.Show(); scanningUserDisplay.BringToFront(); Timer_Barcode.Enabled = false; } else { TextBox_Barcode.Text = ""; Label_Scanning.Text = ""; metroMessageBoxHelper.showWarning(this, "1) Scanning window was not focused while scanning\n" + "2) Barcode was in incorrect format\n" + "3) If you haven't choose English language on your computer", "Warning"); } } else { lastBarcodeTextBoxValue = TextBox_Barcode.Text; if (Label_Scanning.Text.Equals("") || Label_Scanning.Text.Equals("Scanning...")) { Label_Scanning.Text = "Scanning."; } else if (Label_Scanning.Text.Equals("Scanning.")) { Label_Scanning.Text = "Scanning.."; } else if (Label_Scanning.Text.Equals("Scanning..")) { Label_Scanning.Text = "Scanning..."; } } } }