private void button2_Click(object sender, EventArgs e)
{
listBox3.Items.Add(string.Format("{0} {1}", listBox1.Items[0].ToString().Trim() , listBox2.Items[0].ToString().Trim()));
}
如果您需要两个列表框中的所有单词到一个列表框中
private void button2_Click(object sender, EventArgs e)
{
listBox3.Items.Add( string.Format("{0} {1}", string.Join(" ", listBox1.Items.Cast<string>()) , string.Join(" ", listBox2.Items.Cast<string>())));
}
更新 :
private void button2_Click(object sender, EventArgs e)
{
listBox3.Items.AddRange(listBox1.Items.Cast<string>().Zip(listBox2.Items.Cast<string>(), (first, second) => first + " " + second).ToArray());
}