Example #1
0
        public void callControlPopup(string usercontrolname)
        {
            UserControl uc = null;

            if (usercontrolname == "CustomerManageUC")
            {
                uc = new CustomerManageUC();
            }
            else if (usercontrolname == "CustomerUC")
            {
                uc = new CustomerUC();
            }
            else if (usercontrolname == "ProductManageUC")
            {
                uc = new ProductManageUC();
            }
            else if (usercontrolname == "ProductUC")
            {
                uc = new ProductUC();
            }
            else if (usercontrolname == "ReportServiceUC")
            {
                uc = new ReportServiceUC();
            }
            MaskedDialog.ShowDialog(this, uc);
        }
        public static DialogResult ShowDialog(Form parent, UserControl dialog)
        {
            mask         = new MaskedDialog(parent, dialog);
            frmContainer = new Form();
            frmContainer.ShowInTaskbar   = false;
            frmContainer.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            frmContainer.StartPosition   = FormStartPosition.CenterParent;
            frmContainer.Height          = dialog.Height;
            frmContainer.Width           = dialog.Width;

            frmContainer.Controls.Add(dialog);
            mask.MdiParent = parent.MdiParent;
            mask.Show();
            //mask.ShowDialog();
            DialogResult result = frmContainer.ShowDialog(mask);

            frmContainer.Close();
            mask.Close();
            return(result);
        }