同标题,不会的来了就来了吧,就不用叨叨了谢谢

解决方案 »

  1.   

    protected override bool ProcessDialogKey(Keys keyData)
    {
    if (keyData == Keys.Enter && this.ActiveControl is TextBox)
    {
    this.SelectNextControl(this.ActiveControl, true, true, true, true);
    }
    return base.ProcessDialogKey(keyData);
    }
      

  2.   

    private void txtBox1_KeyPress(object sender, KeyPressEventArgs e)
    {
           if (e.KeyChar==13)
           {
                    this.ActiveControl = txtBox2;
                    txtBox2.Focus();
           }
    }
      

  3.   

    private void txtBox1_KeyPress(object sender, KeyPressEventArgs e)
    {
           if (e.KeyChar==13)
           {
               SendKey("Tab");         
           }
    }
    你把TextBox的Tab顺序设置好就OK了!
      

  4.   

    自己改tab键太麻烦了!
    窗口控件如果太多的话!
      

  5.   

    private void txtBox1_KeyPress(object sender, KeyPressEventArgs e)
    {
           if (e.KeyChar==13)
           {
                    this.ActiveControl = txtBox2;
                    txtBox2.Focus();
           }
    }正解!
      

  6.   

    觉得好像明白楼主的意思了,这样试试看:protected override bool ProcessDialogKey(Keys keyData)
    {
    if (keyData == Keys.Enter && this.ActiveControl is TextBox)
    {
    Control ctr = this.GetNextControl(this.ActiveControl, true) ;
    while (!(ctr is TextBox))
    {
    ctr = this.GetNextControl(ctr, true);
    }
    if (ctr is TextBox)
    {
    ctr.Select();
    }
    }
    return base.ProcessDialogKey(keyData);
    }
      

  7.   

    喜欢这个
    private void txtBox1_KeyPress(object sender, KeyPressEventArgs e)
    {
           if (e.KeyChar==13)
           {
               SendKey("Tab");         
           }
    }
    你把TextBox的Tab顺序设置好就OK了!