protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == (Keys.F1 | Keys.Control)) { KontoUtils.SaveLayoutGrid(this.GridLayoutFileName, this.gridView1); return(true); } return(base.ProcessCmdKey(ref msg, keyData)); }
private void listAction1_SaveSettingsButtonClick(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(this.GridLayoutFileName) || this.KontoView == null) { return; } KontoUtils.SaveLayoutGrid(this.GridLayoutFileName, this.KontoView); } catch (Exception ex) { MessageBoxAdv.Show("Error While Saveing", "Error", ex.ToString()); Log.Information(ex, "save layout"); } }
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == (Keys.P | Keys.Control)) { var printBarButtonItem = navAction1.Controls["printSimpleButton"] as SimpleButton; printBarButtonItem.PerformClick(); return(true); } else if (keyData == Keys.F10) { okSimpleButton.PerformClick(); } else if (keyData == Keys.F5) { var filterBarButtonItem = navAction1.Controls["filterSimpleButton"] as SimpleButton; filterBarButtonItem.PerformClick(); return(true); } else if (keyData == Keys.F12) { var listBarButtonItem = navAction1.Controls["listSimpleButton"] as SimpleButton; listBarButtonItem.PerformClick(); return(true); } else if (keyData == Keys.Insert) { var newbBarButtonItem = navAction1.Controls["newSimpleButton"] as SimpleButton; newbBarButtonItem.PerformClick(); return(true); } else if (keyData == (Keys.Home | Keys.Control)) { var firstBarButtonItem = navAction1.Controls["firstSimpleButton"] as SimpleButton; firstBarButtonItem.PerformClick(); return(true); } else if (keyData == (Keys.End | Keys.Control)) { var lastBarButtonItem = navAction1.Controls["lastSimpleButton"] as SimpleButton; lastBarButtonItem.PerformClick(); return(true); } else if (keyData == (Keys.Add | Keys.Control)) { var nextBarButtonItem = navAction1.Controls["nextSimpleButton"] as SimpleButton; nextBarButtonItem.PerformClick(); return(true); } else if (keyData == (Keys.Subtract | Keys.Control)) { var prevBarButtonItem = navAction1.Controls["prevSimpleButton"] as SimpleButton; prevBarButtonItem.PerformClick(); return(true); } else if (keyData == (Keys.F1 | Keys.Shift)) { if (this.KontoLayout != null && !string.IsNullOrEmpty(this.MainLayoutFile)) { KontoUtils.SaveMainFormLayout(this.MainLayoutFile, KontoLayout); } if (this.KontoMainView != null && !string.IsNullOrEmpty(this.GridLayoutFile)) { KontoUtils.SaveLayoutGrid(this.GridLayoutFile, KontoMainView); } return(true); } else if (keyData == (Keys.F2 | Keys.Shift)) { if (KontoMainView == null) { return(false); } if (!KontoMainView.IsFocusedView) { return(false); } var frm = new GridPropertView(); frm.gridControl1.DataSource = this.KontoMainView.GridControl.DataSource; frm.gridView1.Assign(this.KontoMainView, false); if (frm.ShowDialog() != DialogResult.OK) { return(true); } this.KontoMainView.Assign(frm.gridView1, false); KontoUtils.SaveLayoutGrid(this.GridLayoutFile, KontoMainView); } return(base.ProcessCmdKey(ref msg, keyData)); }