From 4b0d4a62c857ce4924b018b7c40eebd1fe9e27dd Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Fri, 23 Jun 2017 22:02:57 -0600 Subject: [PATCH] Fixed hide to tray while maximized bug with issue #77 --- GBM/Forms/frmMain.vb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index baaaa80..58baad7 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -40,6 +40,7 @@ Public Class frmMain Private sPriorCompany As String Private sPriorVersion As String Private iRestoreTimeOut As Integer + Private wState As FormWindowState = FormWindowState.Normal 'Developer Debug Flags Private bProcessDebugMode As Boolean = False @@ -1031,12 +1032,13 @@ Public Class frmMain 'Toggle State with Tray Clicks If Not bShowToggle Then bShowToggle = True - Me.Visible = True + Me.WindowState = wState Me.ShowInTaskbar = True Me.Focus() Else bShowToggle = False - Me.Visible = False + wState = Me.WindowState + Me.WindowState = FormWindowState.Minimized Me.ShowInTaskbar = False End If End Sub @@ -1663,7 +1665,8 @@ Public Class frmMain e.Cancel = True If Not mgrCommon.IsUnix Then bShowToggle = False - Me.Visible = False + wState = Me.WindowState + Me.WindowState = FormWindowState.Minimized Me.ShowInTaskbar = False End If End If