private static MsgBoxControl AdjustDialogScreen
            (string message, string title, MessageBoxButtons buttons,
            MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, int height,
            Form ownerForm)
        {
            var msgboxControl = new MsgBoxControl {
                BackColor = ownerForm.BackColor
            };

            msgboxControl.Properties.Buttons       = buttons;
            msgboxControl.Properties.DefaultButton = defaultButton;
            msgboxControl.Properties.Icon          = icon;
            msgboxControl.Properties.Message       = message;
            msgboxControl.Properties.Title         = title;
            msgboxControl.Padding       = new Padding(0, 0, 0, 0);
            msgboxControl.ControlBox    = false;
            msgboxControl.ShowInTaskbar = false;
            msgboxControl.TopMost       = true;
            msgboxControl.Size          = new Size(ownerForm.Size.Width - 100, height);
            msgboxControl.Location      = new Point(ownerForm.Location.X + (ownerForm.Width - msgboxControl.Width) / 2, ownerForm.Location.Y + (ownerForm.Height - msgboxControl.Height) / 2);
            msgboxControl.AdjustAppearance();
#pragma warning disable IDE0059 // Asignación innecesaria de un valor
            int _overlaySizes = Convert.ToInt32(Math.Floor(msgboxControl.Size.Height * 0.28));
#pragma warning restore IDE0059 // Asignación innecesaria de un valor
            msgboxControl.ShowDialog();
            msgboxControl.BringToFront();
            msgboxControl.SetDefaultButton();
            return(msgboxControl);
        }
 private static void ModalState(MsgBoxControl control)
 {
     while (control.Visible)
     {
     }
 }
示例#3
0
 public MsgBoxProperties(MsgBoxControl owner) =>