using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string list="";
for (int i = (listBox1.Items.Count - 1); i >= 0; i--)
{
if (listBox1.GetSelected(i))
{
list = listBox1.Items[i].ToString();
listBox1.Items.Remove(listBox1.Items[i]);
listBox2.Items.Add(list);
}
}
}
private void button2_Click(object sender, EventArgs e)
{
string list="";
for (int i = (listBox2.Items.Count - 1); i >= 0; i--)
{
if (listBox2.GetSelected(i))
{
list=listBox2.Items[i].ToString();
listBox2.Items.Remove(listBox2.Items[i]);
listBox1.Items.Add(list);
}
}
}
}
}
沒有留言:
張貼留言