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);
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章