在文本框的 KeyPress事件中
private void txt_userid_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
    {
      if(e.KeyChar==13)
      { 
        //将光标定位到下一个文件框
        txt_password.Focus();
      }
    }