请问我在listbox 想实现左边的框里添加字段,按按钮可以添加到右边的框中.
请问我在listbox 想实现左边的框里添加字段,按按钮可以添加到右边的框中.private void btnMove_Click(object sender, EventArgs e)
{
if (this.chkListPossibleValue.CheckedItems.Count > 0)
{
this.lstSelected.Items.Clear();
foreach (string item in this.chkListPossibleValue.CheckedItems)
{
this.lstSelected.Items.Add(item.ToString());
}
for (int i = 0; i < this.chkListPossibleValue.Items.Count; i++)
this.chkListPossibleValue.SetItemChecked(i, false);
}
}
编译出现错误:“System.Windows.Forms.ListBox”并不包含“CheckedItems”的定义. --------------------编程问答-------------------- listbox哪有什么CheckedItems,只有SelectedItems --------------------编程问答-------------------- private void 易做图Button1_Click(object sender, System.EventArgs e)
{
if(this.listBoxControl1.Items.Count!=0)
{
this.listBoxControl2.Items.Add(this.listBoxControl1.SelectedItem);
this.listBoxControl2.SelectedItem=this.listBoxControl1.SelectedItem;
this.listBoxControl1.Items.Remove(this.listBoxControl1.SelectedItem);
}
} --------------------编程问答-------------------- checkeditems属性只有checkedlistbox才有 --------------------编程问答--------------------
冒充黄瓜哥
补充:.NET技术 , C#