我需要将项目从一个ListBox移动到另一个ListBox。添加到第二个ListBox中可以工作,但我想移动多个所选项目。
private void btnMove_Click(object sender, EventArgs e)
{
if (listBox2.SelectedItem != null)
{
listBox3.Items.Add(listBox2.SelectedItem);
listBox2.Items.Remove(listBox2.SelectedItem);
}
}
我的问题是这个程序只能逐个移动物品,但我需要能够在一次点击中移动多个选定的物品。