/// <summary>Called when run mode starts, but also if set is changed while running</summary> public void DisplayDocument(Document document) { m_Document = document; m_Page = document.Pages.First(); this.WindowState = FormWindowState.Normal; MainView.DisplayPage(m_Page, document); StringBuilder title = new StringBuilder(); title.Append(Strings.Item("App")); title.Append(" (v").Append(SoftwareVersion.VersionString).Append(")"); title.Append(" - ").Append(m_Document.FileTitle()); this.Text = title.ToString(); Rectangle targetPosition = m_Document.SAWHeader.GetAdjustedWindowBounds(); if (!targetPosition.IsEmpty) { GUIUtilities.SetFormClientBounds(this, targetPosition); Debug.WriteLine($"frmRun target position={targetPosition}, using ClientRectangle={ClientRectangle}, resulting panel={RectangleToScreen(MainView.Bounds)}"); } }