public partial class frmSimulateStacking : Form{frmSimulateStacking fSimStacking;Product myProduct;public frmSimulateStacking(){InitializeComponent();//soon after the init//Console.WriteLine(cmbProdNumber.SelectedIndex.ToString());}private void frmSimulateStacking_Load(object sender, EventArgs e){//cmbProdNumber.SelectedIndex = -1;DataTable dt = Product.GetAllProductCodes(); cmbProdNumber.DataSource = dt;cmbProdNumber.DisplayMember = "PProdCode";cmbProdNumber.ValueMember = "PProdCode";myProduct = new Product();//Console.WriteLine(cmbProdNumber.SelectedIndex.ToString()); }private void cmbProdNumber_SelectedIndexChanged(object sender, EventArgs e){//not codedif (cmbProdNumber.Items.Count != 0){//Console.WriteLine(cmbProdNumber.SelectedValue.ToString());List<string> lstCollection = myProduct.GetProductNameByCode(cmbProdNumber.Text);foreach (string item in lstCollection){tbxProdName.Text = item;}}}