protected void Button6_Click(object sender, EventArgs e)
{
//清除列表控件值方法1
for (int i = ListBox2.Items.Count - 1; i >= 0; i--)
{
if (ListBox2.Items[i].Selected)
{
ListBox2.Items.Remove(ListBox2.Items[i]);
}
}
//清除列表控件值方法2
for (int i = ListBox2.Items.Count-1; i >= 0;i-- )
{
if (ListBox2.Items[i].Selected)
{
ListBox2.Items.RemoveAt(i);
}
}
}
点菜名
protected void Button7_Click(object sender, EventArgs e)
{
for (int i = ListBox1.Items.Count-1; i >= 0;i-- )
{
if (ListBox1.Items[i].Selected)
{
ListBox3.Items.Add(ListBox1.Items[i]);
ListBox1.Items.RemoveAt(i);
}
}
}
protected void Button8_Click(object sender, EventArgs e)
{
for (int i = ListBox3.Items.Count-1; i >= 0;i--)
{
if (ListBox3.Items[i].Selected)
{
ListBox1.Items.Add(ListBox3.Items[i]);
ListBox3.Items.RemoveAt(i);
}
}
}