日期:2014-05-18 浏览次数:20946 次
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { bool result =false; Control c = Control.FromHandle(msg.HWnd); if (msg.HWnd == this.dataGridView1.Handle || (c is DataGridViewTextBoxEditingControl)) { if (msg.WParam.ToInt32() == (int)Keys.Return) { this.dataGridView1.CurrentCell = this.dataGridView1.CurrentRow.Cells[this.dataGridView1.CurrentCell.RowIndex + 1]; result = true; } } else { result = base.ProcessCmdKey(ref msg, keyData); } return result; }