private void OnAccessorKeyPressed(object sender, AcceleratorKeyPressedEventArgs e) { uint currentStyle = this.GetWindowStyle(); uint currentExStyle = this.GetWindowExStyle(); if (e.KeyVentType == KeyEventType.KeyDown && e.VirtualKey == Diga.Core.Api.Win32.VirtualKeys.VK_F11) { if (currentStyle == NoneStyle && currentExStyle == NoneExStyle) { this.SetWindowState(WindowState.Normal); this.UpdateStyle(this.OldStyle); this.UpdateExStyle(this.OldExStyle); this.UpdateWidow(); } else { this.OldStyle = currentStyle; this.OldExStyle = currentExStyle; this.SetWindowState(WindowState.Maximized); this.UpdateStyle(NoneStyle); this.UpdateExStyle(NoneExStyle); this.UpdateWidow(); } NativeApp.DoEvents(); } }
private void FormKeyDown(object sender, NativeKeyEventArgs e) { if (e.VirtalKey == Diga.Core.Api.Win32.VirtualKeys.VK_F11) { this.SetWindowState(WindowState.Maximized); NativeApp.DoEvents(); } }