练习ListBox控件用法。
利用两个列表框和4个按钮实现课程的添加全部(借助循环),删除全部,添加选定和删除选定。所使用到的有Add方法,Remove方法,SelectedItems属性(选定项集合)等。滚动条可利用Scrollbar。
代码:
sing System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Example09
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label2_Click(object sender, EventArgs e)
{