/// <summary> /// 快捷键 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dataGridView1_KeyDown(object sender, KeyEventArgs e) { try { if (e.Modifiers == Keys.Control) { switch (e.KeyCode) { case Keys.X: oilEdit.CPasteClipboardValue(this.dataGridView1); //从输入列表和数据库中删除数据 oilEdit.CDeleteValues(this.dataGridView1); break; case Keys.C: oilEdit.CCopyToClipboard(this.dataGridView1); break; case Keys.V: oilEdit.CPasteClipboardValue(this.dataGridView1); break; } } if (e.KeyCode == Keys.Delete) { //从输入列表和数据库中删除数据 oilEdit.CDeleteValues(this.dataGridView1); } } catch (Exception ex) { Log.Error(ex); // MessageBox.Show("编辑操作失败! " + ex.Message, "编辑", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void 制ToolStripMenuItem_Click(object sender, EventArgs e) { oilEdit.CCopyToClipboard(this._selectGridView); }