Hide();\r
}\r
\r
+ public void ChangeWindowState(FormWindowState newState)\r
+ {\r
+ if (!Visible)\r
+ return;\r
+ if (newState == FormWindowState.Minimized)\r
+ {\r
+ if (WindowState == FormWindowState.Normal)\r
+ WindowState = FormWindowState.Minimized;\r
+ if (_config.HideOnMinimized)\r
+ ShowInTaskbar = false;\r
+ }\r
+ else\r
+ {\r
+ if (WindowState == FormWindowState.Minimized)\r
+ {\r
+ Application.DoEvents();\r
+ if (_config.HideOnMinimized)\r
+ ShowInTaskbar = true;\r
+ WindowState = FormWindowState.Normal;\r
+ }\r
+ }\r
+ }\r
+\r
private void ListForm_Activated(object sender, EventArgs e)\r
{\r
if (_suppressActivate.Check())\r
SuppressActivate.Start();\r
if (WindowState == FormWindowState.Minimized)\r
{\r
- _listForm.WindowState = FormWindowState.Minimized;\r
if (Config.HideOnMinimized)\r
- _listForm.ShowInTaskbar = ShowInTaskbar = false;\r
+ ShowInTaskbar = false;\r
}\r
- else if (_listForm.WindowState == FormWindowState.Minimized)\r
- {\r
- DoPaint();\r
- _listForm.ShowInTaskbar = true;\r
- _listForm.WindowState = FormWindowState.Normal;\r
- }\r
- }\r
-\r
- private void DoPaint()\r
- {\r
- Application.DoEvents();\r
+ _listForm.ChangeWindowState(WindowState);\r
}\r
\r
public TimeOutChecker SuppressActivate = new TimeOutChecker();\r