int c = 0; private void button1_Click(object sender, EventArgs e) { int v; v = c++; panel1.VerticalScroll.Value = VerticalScroll.Minimum; UserControl1 us = new UserControl1(); us.Name = "us" + v; us.Location = new Point(150, 5 + (30 * v)); us.Tag = btn; panel1.Controls.Add(us); }
UserControl1 uss = new UserControl1(); public bool validation() { if (uss.comboBox1.Text == string.Empty) { return true; } else { return false; } }
bool vss = validation(); if (!vss) { errorlabel.Visible = false; //this label is defaultly set to false Form4 fl = new Form4(); fl.Show(); } else { errorlabel.Visible = true; //this label is defaultly set to false } //but the validation is not done properly, whats the problem here
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)