private void comboName_SelectedIndexChanged(object sender, EventArgs e) { var list = product.GetBarcodeList(); barcodeTxt.Text = list[comboName.SelectedIndex].ToString(); }