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;
}
else if (keyData == (Keys.Enter|Keys.Shift))
{
keyData = Keys.Tab | Keys.Shift;
}
return base.ProcessDialogKey(keyData);
}
}
剛才考慮不周
すばらしいコードを書き出すのは楽しい事です