谢谢
我是这样想的
1,怎样判断textbox里共有多少行?2,怎样取到每一行的值,并添加到listbox

解决方案 »

  1.   

    textBox.Lines  这个数组里面有你要的东西
      

  2.   

    1.textBox1.Lines.Length2.for(int i=0;i<textBox1.Lines.Length;i++)
    {
    listBox.Items.Add(textBox1.Lines[i]);
    }
      

  3.   

    1,怎样判断textbox里共有多少行?
    textBox1.Lines.Length
    2,怎样取到每一行的值,并添加到listbox
    string[] tempArray = new string [textBox1.Lines.Length];
    tempArray = textBox1.Lines;
    for(int counter=0; counter < tempArray.Length;counter++)
    {
      list.Items.Add(tempArray[counter]);
    }