private void del_comboBox_and_numericUpDown_from_form(comboBox_and_numericUpDown cb_and_nud) { last_h -= delta_size; this.Size = new Size(this.Size.Width, this.Size.Height - delta_size); this.Controls.Remove(cb_and_nud.cb); this.Controls.Remove(cb_and_nud.nud); }
public void push_comboBox_and_numericUpDown(comboBox_and_numericUpDown cb_and_nud) { if (list != null) { list.Add(cb_and_nud); add_comboBox_and_numericUpDown_to_form(cb_and_nud); } }
private void add_comboBox_and_numericUpDown_to_form(comboBox_and_numericUpDown cb_and_nud) { cb_and_nud.cb.Location = new Point(shift_for_comboBox, last_h); cb_and_nud.nud.Location = new Point(shift_for_numericUpDown, last_h); last_h += delta_size; this.Size = new Size(this.Size.Width, this.Size.Height + delta_size); this.Controls.Add(cb_and_nud.cb); this.Controls.Add(cb_and_nud.nud); }
private void numericUpDown1_ValueChanged(object sender, EventArgs e) { if (list != null) { while (list.Count != numericUpDown1.Value) { if (list.Count < numericUpDown1.Value) { comboBox_and_numericUpDown cb_and_nud = new comboBox_and_numericUpDown(); push_comboBox_and_numericUpDown(cb_and_nud); } else { pop_comboBox_and_numericUpDown(); } } } }