当我按Enter
按钮时,Tab
事件
form1_keydown
Control nextControl;
if (e.KeyCode == Keys.Enter)
{
nextControl = GetNextControl(ActiveControl, !e.Shift);
nextControl.Focus();
e.SuppressKeyPress = true;
}
表单中有comboBox
,我们按Enter
按钮,然后按New Form
。
该怎么做因为它不适用于cmb_KeyPress
事件
答案 0 :(得分:1)
在这里你可以这样:
Control nextControl;
if (e.KeyCode == Keys.Enter)
{
nextControl = GetNextControl(ActiveControl, !e.Shift);
nextControl.Focus();
if(nextControl=Combo)
{
KeyPreview=false;
}
e.SuppressKeyPress = true;
}