protected override ExceptionDialogAction Show() { var control = new ExceptionDialogControl(Exception, Message, Actions, CloseForm, CloseForm); _form = new DialogBoxForm(Title, control, Size.Empty, DialogSizeHint.Auto); var screen = ScreenFromActiveForm() ?? ScreenFromMousePosition(); int xdiff = screen.Bounds.Width - _form.Bounds.Width; int ydiff = screen.Bounds.Height - _form.Bounds.Height; int locationX = screen.WorkingArea.Left + Math.Max(0, (xdiff)/2); int locationY = screen.WorkingArea.Top + Math.Max(0, (ydiff)/2); _form.StartPosition = FormStartPosition.Manual; _form.Location = new Point(locationX, locationY); //_form.TopMost = true; _form.ShowDialog(); return control.Result; }
protected override ExceptionDialogAction Show() { var control = new ExceptionDialogControl(Exception, Message, Actions, CloseForm, CloseForm); _form = new DialogBoxForm(Title, control, Size.Empty, DialogSizeHint.Auto); var screen = ScreenFromActiveForm() ?? ScreenFromMousePosition(); int xdiff = screen.Bounds.Width - _form.Bounds.Width; int ydiff = screen.Bounds.Height - _form.Bounds.Height; int locationX = screen.WorkingArea.Left + Math.Max(0, (xdiff) / 2); int locationY = screen.WorkingArea.Top + Math.Max(0, (ydiff) / 2); _form.StartPosition = FormStartPosition.Manual; _form.Location = new Point(locationX, locationY); //_form.TopMost = true; _form.ShowDialog(); return(control.Result); }