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 arblistbox
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (listBox1.Items.Count == 0)
return;
if (listBox1.SelectedItem == null)
return;
listBox2.Items.Add(listBox1.SelectedItem);
listBox1.Items.Remove(listBox1.SelectedItem);
}
private void button2_Click(object sender, EventArgs e)
{
if (listBox1.Items.Count == 0)
return;
for(int i=0;i<listBox1.Items.Count;i++)
{
listBox2.Items.Add(listB
在C#中实现两个listbox的项移动(winform)
最新推荐文章于 2024-03-25 00:06:23 发布