private void BtnAddParticipants_Click(object sender, EventArgs e) { AtelierUserManaging actualModal = new AtelierUserManaging(atelierId); actualModal.Dock = DockStyle.Fill; mainForm.Instance.PnlContainer.Controls.Add(actualModal); mainForm.Instance.PnlContainer.Controls["AtelierUserManaging"].BringToFront(); }
private void cleanAndRefresh() { foreach (Control item in mainForm.Instance.PnlContainer.Controls) { if (item.Name == "AtelierUserManaging") { mainForm.Instance.PnlContainer.Controls.Remove(item); item.Dispose(); // Release all the resources used by the control break; } } AtelierUserManaging ucManaging = new AtelierUserManaging(atelierId); ucManaging.Dock = DockStyle.Fill; mainForm.Instance.PnlContainer.Controls.Add(ucManaging); mainForm.Instance.PnlContainer.Controls["AtelierUserManaging"].BringToFront(); }