From 618c1010b2589d35d94c0829e80757fc78a44798 Mon Sep 17 00:00:00 2001 From: Lorenz Cuno Klopfenstein Date: Tue, 22 Mar 2011 12:36:15 +0100 Subject: [PATCH] Fixed side panel hiding (focus gets back to main form and panel is disposed correctly). --- OnTopReplica/MainForm_ChildForms.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OnTopReplica/MainForm_ChildForms.cs b/OnTopReplica/MainForm_ChildForms.cs index 15ea7f3..92da5fe 100644 --- a/OnTopReplica/MainForm_ChildForms.cs +++ b/OnTopReplica/MainForm_ChildForms.cs @@ -78,11 +78,15 @@ namespace OnTopReplica { //Unhook listener to make panel freeable _currentSidePanel.RequestClosing -= RequestClosingHandler; - //Remove side panel + //Remove side panel and container _currentSidePanel.OnClosing(this); + _currentSidePanel.Hide(); _sidePanelContainer.Controls.Clear(); _sidePanelContainer.Visible = _sidePanelContainer.Enabled = false; + + //Free panel _currentSidePanel = null; + _currentSidePanel.Dispose(); //Resize MinimumSize = new Size(20, 20); @@ -92,6 +96,9 @@ namespace OnTopReplica { ); ExtraPadding = new Padding(0); _thumbnailPanel.Size = ClientSize; + + //Put focus back to main form + this.Focus(); } void SidePanel_RequestClosing(object sender, EventArgs e) {