private void Init_TexterWindow_UI() { /* Initially add one control to the panel. */ usercontrol.uc_texter NewControl = new usercontrol.uc_texter(flowLayoutPanel1.Controls.Count.ToString()); flowLayoutPanel1.Controls.Add(NewControl); timer1.Start(); }
private void button1_Click(object sender, EventArgs e) { /* Add button */ if (flowLayoutPanel1.Controls.Count < 10) { /* To add user control at runtime. */ usercontrol.uc_texter NewControl = new usercontrol.uc_texter(flowLayoutPanel1.Controls.Count.ToString()); flowLayoutPanel1.Controls.Add(NewControl); } else { MessageBox.Show("Maximum Limit Reached!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); } }