Beispiel #1
0
        //
        public static DialogResult ShowDialog(Form parent, Form dialog)
        {
            _mask = new MaskedDialog(parent, dialog);
            dialog.StartPosition = FormStartPosition.CenterParent;
            _mask.MdiParent      = parent.MdiParent;
            _mask.BringToFront();
            _mask.Show(parent);
            DialogResult result = dialog.ShowDialog(_mask);

            _mask.Close();
            return(result);
        }
Beispiel #2
0
        public static DialogResult ShowDialog(Form parent, UserControl dialog)
        {
            _mask         = new MaskedDialog(parent, dialog);
            _frmContainer = new Form();
            _frmContainer.ShowInTaskbar   = false;
            _frmContainer.FormBorderStyle = FormBorderStyle.None;
            _frmContainer.StartPosition   = FormStartPosition.CenterScreen;
            _frmContainer.Height          = dialog.Height;
            _frmContainer.Width           = dialog.Width;

            _frmContainer.Controls.Add(dialog);
            _mask.MdiParent = parent.MdiParent;
            _mask.Show();
            DialogResult result = _frmContainer.ShowDialog(_mask);

            _frmContainer.Close();
            _mask.Close();
            return(result);
        }