windows mobile C# net3.5 上下键移动焦点事件

private void TextBoxUpDown_KeyDown(object sender, KeyEventArgs e)
{
Control ctl = (Control)sender;
if (e.KeyCode == Keys.Down)
{
  if (ctl.TabIndex == 7)
  {
    tabControl1.SelectedIndex = 1;
    cbModify.Focus();
    this.SelectNextControl(this, true, true, true, true);
     return;
  }
  this.SelectNextControl(ctl, true, true, true, true);
}
if (e.KeyCode == Keys.Up)
{
  if (ctl.TabIndex == 9)
  {
    tabControl1.SelectedIndex = 0;
    cbModify.Focus();
    this.SelectNextControl(this, true, true, true, true);
    return;
  }
  this.SelectNextControl(ctl, false, true, true, true);
}

原文地址:https://www.cnblogs.com/cntom/p/2339676.html