using FastReport.Forms; using System.Windows.Forms; namespace FastReport.Design.PageDesigners.Dialog { partial class DialogPageDesigner { private void UpdatePageFormLocation() { if (DialogPage == null) return; // avoid "bad form owner" bug System.Windows.Window designerForm = System.Windows.Window.GetWindow(Designer.control); if (designerForm == null || !designerForm.IsVisible) return; BaseForm form = DialogPage.Form; form.StartPosition = FormStartPosition.Manual; // 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.MoveWindow(sc.WorkingArea.Left, sc.WorkingArea.Bottom, designerForm); form.Show(); form.SendToBack(); DialogPage.ResetFormBitmap(); Focus(); } private void HidePageForm() { if (DialogPage == null) return; DialogPage.Form.Hide(); } } }