private void Shell_Activated(object sender, EventArgs e) { //ClientLog.Message("Shell Activated"); SessionManager.AdjustMainMenuPosition(); if (Progress.Instance != null && Progress.Instance.Visible) { // if progress dialog showing then treat as modal by keeping focus there and not responding to clicks on Shell controls // (todo: replace this hack with better code in Progress) Progress.Instance.Focus(); Application.DoEvents(); } }
private void Shell_Resize(object sender, EventArgs e) { SessionManager.AdjustMainMenuPosition(); if (WindowState == FormWindowState.Maximized || WindowState == FormWindowState.Normal) { // save window state and size if normal or maximized string state = ((int)WindowState).ToString() + "," + Left.ToString() + "," + Top.ToString() + "," + Width.ToString() + "," + Height.ToString(); if (SessionManager.Instance != null) { SessionManager.Instance.ShellFormSize = state; } } }