DialogPageDesigner.Mono.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using FastReport.Forms;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4. namespace FastReport.Design.PageDesigners.Dialog
  5. {
  6. partial class DialogPageDesigner
  7. {
  8. private void UpdatePageFormLocation()
  9. {
  10. if (DialogPage == null)
  11. return;
  12. // avoid "bad form owner" bug
  13. Form designerForm = Designer.FindForm();
  14. if (designerForm == null || !designerForm.Visible)
  15. return;
  16. BaseForm form = DialogPage.Form;
  17. form.StartPosition = FormStartPosition.Manual;
  18. // locate the form on the bottom of the designer's screen. This will autoscale the form
  19. // according to the designer's dpi; also the form will not be visible on undo operations.
  20. Screen sc = Screen.FromControl(designerForm);
  21. form.Location = new Point(sc.WorkingArea.Left, sc.WorkingArea.Bottom);
  22. form.Show();
  23. form.SendToBack();
  24. DialogPage.ResetFormBitmap();
  25. Focus();
  26. }
  27. private void HidePageForm()
  28. {
  29. if (DialogPage == null)
  30. return;
  31. DialogPage.Form.Hide();
  32. }
  33. }
  34. }