public static FormAccounts getInstance() { if (instance == null) { instance = new FormAccounts(); } return(instance); }
private void gérerToolStripMenuItem_Click(object sender, EventArgs e) { bool IsOpen = false; foreach (Form f in Application.OpenForms) { if (f.Text == "FormDishes") { IsOpen = true; f.Focus(); break; } } if (IsOpen == false) { FormAccounts f2 = new FormAccounts(); f2.MdiParent = this; f2.Show(); } }
private void FormAddAccount_FormClosing(object sender, FormClosingEventArgs e) { FormAccounts form = FormAccounts.getInstance(); form.refreshData(); }
public FormAccounts() { InitializeComponent(); instance = this; }