using FastReport.Forms; using System.Drawing; using System.Windows.Forms; namespace FastReport.Design.PageDesigners.Dialog { partial class DialogPageDesigner { private void UpdatePageFormLocation() { if (DialogPage == null) return; // avoid "bad form owner" bug Form designerForm = Designer.FindForm(); if (designerForm == null || !designerForm.Visible) return; BaseForm form = DialogPage.Form; form.StartPosition = FormStartPosition.Manual; form.Location = new Point(-10000, -10000); form.Show(); form.SendToBack(); // locate the form on the bottom of the designer's screen. This will autoscale the form // according to the designer's dpi; also the form will not be visible on undo operations. Screen sc = Screen.FromControl(designerForm); form.Location = new Point(sc.WorkingArea.Left, sc.WorkingArea.Bottom); DialogPage.ResetFormBitmap(); Focus(); } private void HidePageForm() { if (DialogPage == null) return; DialogPage.Form.Hide(); } } }