private void btnNewProduct_Click(object sender, EventArgs e) { if (!Helper.HasWriteAccess(ApplicationFroms.ucNewProduct)) { return; } frmControlHost host = new frmControlHost(); ucNewProduct product = new ucNewProduct(); this.TopMost = false; this.Close(); product.Dock = DockStyle.Fill; host.Controls.Add(product); host.ShowDialog(); }
private void btnNewProduct_Click(object sender, EventArgs e) { if (!Helper.HasWriteAccess(ApplicationFroms.ucNewProduct)) { return; } Helper.WaitCursor(this); HideControls(_controls); Suspend(); ucNewProduct newProduct = new ucNewProduct(); newProduct.Dock = DockStyle.Fill; scContainer.Panel2.Controls.Add(newProduct); AddControls(newProduct); Resume(); Helper.DefaultCursor(this); }