public DelButton(MyForm form1, MyTextBox textBox) { id++; buttons.Add(this); form = form1; this.textBox = textBox; DelButton_Initiate(); }
private void DelButton_Click(object sender, EventArgs e) { form.Height -= 22; for (int i = buttons.IndexOf(this) + 1; i < buttons.Count; i++) { buttons[i].textBox.Up(); buttons[i].Location = new System.Drawing.Point(buttons[i].Location.X, buttons[i].Location.Y - 22); } id--; textBox.Close(); form.Controls.Remove(this); buttons.Remove(this); textBox = null; System.GC.Collect(); }
private void AddButton_Click(object sender, EventArgs e) { form.Height += 22; textBox = new MyTextBox(form); new DelButton(form, textBox); }
public AlarmGears(MyTextBox textBox) { this.textBox = textBox; }