void InputBarcode_Load(object sender, EventArgs e) { barcodes = new Barcodes(); InitDataGridView(); barcodeLen = int.Parse(ConfigurationManager.AppSettings["barcodeLen"]); for (int i = 0; i < barcodes.allRackSmpPlasmaSlices.Count; i++) { lstRackIDs.Items.Add(string.Format("架子{0}", i + 1)); } lstRackIDs.SelectedIndex = 0; selectedCell = dataGridView.Rows[0].Cells[0]; }