private void RwkSNScanBoxTimer_Tick(object sender, EventArgs e) { RwkSNScanBoxTimer.Stop(); string ScannedSN = RwkSNScanBox.Text; connect(); string partNumber = read(ScannedSN); Console.WriteLine("The queried part number is: " + partNumber); SubassyPNLbl.Text = partNumber; SubassyPNLbl.Visible = true; SubassyPNLbl.Refresh(); // Load the component part numbers into the form string[] compPNs = readCompPNs(ScannedSN); //int i = 1; foreach (string PNstr in compPNs) { Console.WriteLine("PNstr = " + PNstr); if (PNstr != null) { Console.WriteLine("Component part number: " + PNstr); string labelToMod = "CompPNLbl" + ControlCounter; var control = Controls.OfType <Label>().FirstOrDefault(c => c.Name == labelToMod); control.Text = PNstr; control.Visible = true; control.Refresh(); string checkboxToMod = "CompPNChkBx" + ControlCounter; var controlCB = Controls.OfType <CheckBox>().FirstOrDefault(c => c.Name == checkboxToMod); controlCB.Visible = true; controlCB.Refresh(); ControlCounter++; } Console.WriteLine("ControlCounter = " + ControlCounter); } }
private void RwkSNScanBox_TextChanged(object sender, EventArgs e) { RwkSNScanBoxTimer.Start(); }