如果是操作textbox可以直接用
lines集合索引!

解决方案 »

  1.   

    private void textBox1_KeyPress(object sender,   System.Windows.Forms.KeyPressEventArgs e)
    {
    if(e.KeyChar == (char)13)//如果是回车
    {
    textBox2.SelectAll();
    textBox2.Focus();
    }
    }
      

  2.   

    感谢大家使用微软产品。 我们可以用 System.Environment.NewLine 系统属性来得到回车换行.
    如:
    textBox1.Text = "test Row1" + System.Environment.NewLine  + "Test Row2";
    更具体的说明和源码请参考下面这些资料: 
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemEnvironmentClassNewLineTopic.asp
    - 微软全球技术中心 技术支持 本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款
    (http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。
      

  3.   

    sailing_ms([微软]启航) 解释是对的,
     不过你是那里来的?M$的人也有时间来?
      

  4.   

    Mac, Unix, Windows上的换行符是不一样的
    没记错的话分别是
    \r
    \n
    \r\n
    大家还是用sailing_ms的方法好