第一个问题:
重写 DataGridView..
public class MyDataGridView :DataGridView
{
protected override void OnKeyDown(KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SendKeys.Send("{TAB}");
e.SuppressKeyPress = true;
}
base.OnKeyDown(e);
}
protected override bool ProcessDialogKey(Keys keyData)
{
if (keyData == Keys.Enter)
{
keyData = Keys.Tab;
}
return base.ProcessDialogKey(keyData);
}
}
然后在 引用DGV控件的窗体的Desiner里 写 DataGridView dataGridView1 = new MyDataGridView;
ok啦