编辑器加载中...
//首先将窗体的 keypreview 的属性设为 true
private
void
窗体_KeyPress(
object
sender, KeyPressEventArgs e)
{
if
( e.KeyChar == (
char
)13 )
{
this
.SelectNextControl(
this
.ActiveControl,
true
,
true
,
false
,
true
);
}
}
//或
private
void
Form1_KeyDown(
object
sender, KeyEventArgs e)
{
if
( e.KeyData == Keys.Enter )
{
this
.SelectNextControl(
this
.ActiveControl,
true
,
true
,
false
,
true
);
}
}