Items编辑器

来源:互联网 发布:家装diy设计软件 编辑:程序博客网 时间:2024/06/06 02:38
功能:选择左边的选项,单击move按钮,然后移动到右边。
Items编辑器 - 行也思君 - 行也思君
 

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 Lists{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();            CheckedListBoxPossibleValues.Items.Add("Ten");//增加到Items        }        private void button1_Click(object sender, EventArgs e)//单击按钮击发事件        {            if (CheckedListBoxPossibleValues.CheckedItems.Count > 0)            {                listBoxSelected.Items.Clear();//清除上次的Items                foreach (string item in CheckedListBoxPossibleValues.CheckedItems)//遍历                {                    listBoxSelected.Items.Add(item.ToString());//增加到右边                }                for (int i = 0; i < CheckedListBoxPossibleValues.Items.Count; i++)                    CheckedListBoxPossibleValues.SetItemChecked(i, false);//初始化            }        }    }}


原创粉丝点击