public override void BeginScreenDeviceChange(bool willBeFullScreen) { if (willBeFullScreen && !isFullScreenMaximized && form != null) { savedFormBorderStyle = form.FormBorderStyle; } if (willBeFullScreen != isFullScreenMaximized) { deviceChangeChangedVisible = true; oldVisible = Visible; Visible = false; if (form != null) { form.SendToBack(); } } else { deviceChangeChangedVisible = false; } if (!willBeFullScreen && isFullScreenMaximized && form != null) { form.TopMost = false; form.FormBorderStyle = savedFormBorderStyle; } deviceChangeWillBeFullScreen = willBeFullScreen; }
internal void ActivateNextChild() { if (Controls.Count < 1) { return; } if (Controls.Count == 1 && Controls[0] == ActiveMdiChild) { return; } Form front = (Form)Controls [0]; Form form = (Form)Controls [1]; ActivateChild(form); front.SendToBack(); }
// window positioning flags public static void PinWindowToDesktop(Form form) { // for XP and 2000, the following hack pins the window to the desktop quite nicely // (ie. pressing show desktop still shows, the calendar), but it can only be called // once during init for it to work. try { form.SendToBack(); IntPtr pWnd = FindWindow("Progman", null); SetParent(form.Handle, pWnd); } catch (Exception ex) { ConfigLogger.Instance.LogError(String.Format("Error pinning window to desktop, OS: {0}.", Environment.OSVersion.Version)); MessageBox.Show(form, Resources.ErrorInitializingApp + Environment.NewLine + ex.Message, Resources.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); } }