Пример #1
0
 private void GC_Main_EditorKeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F2)
     {
         if (F2FieldBody.Contains(GV_Main.FocusedColumn.FieldName))
         {
             ButtonEdit   edit = (GV_Main.ActiveEditor as ButtonEdit);
             EditorButton eb   = ((RepositoryItemButtonEdit)GV_Main.FocusedColumn.ColumnEdit).Buttons[0];
             PerformClick(GV_Main.FocusedColumn.FieldName, edit, new ButtonPressedEventArgs(eb));
         }
     }
 }
Пример #2
0
 private void GC_Main_EditorKeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Delete && e.Modifiers == Keys.Control)
     {
         if (GV_Main.RowCount > 0 && FocuseRow_Main <= GV_Main.RowCount)
         {
             if (MessageBox.Show("確定要刪除此筆資料?", "詢問", MessageBoxButtons.OKCancel) == DialogResult.OK)
             {
                 IsNowDeleteRow = true;
                 GV_Main.DeleteRow(FocuseRow_Main);
                 GV_Main.RefreshData();
             }
         }
     }
     else if (e.KeyCode == Keys.F2)
     {
         if (F2FieldBody.Contains(GV_Main.FocusedColumn.FieldName))
         {
             ButtonEdit   edit = (GV_Main.ActiveEditor as ButtonEdit);
             EditorButton eb   = ((RepositoryItemButtonEdit)GV_Main.FocusedColumn.ColumnEdit).Buttons[0];
             PerformClick(GV_Main.FocusedColumn.FieldName, edit, new ButtonPressedEventArgs(eb));
         }
     }
 }