listbox1添加到listbox2中处理
来源:互联网 发布:redis数据加密 编辑:程序博客网 时间:2024/06/15 23:38
for (int i = 0; i < this.ListBox1.Items.Count; i++)
{
if (this.ListBox1.Items[i].Selected == true)
{
if (this.ListBox2.Items.Count == 0) { this.ListBox2.Items.Add(ListBox1.Items[i]); } // listbox2中没有数据
else
{
for (int j = 0; j < this.ListBox2.Items.Count; j++)
{
//listbox中是否已存在
if (ListBox2.Items[j].Text.ToString().Equals(ListBox1.Items[i].Text.ToString()))
{
break; //跳出本次循环
}
if (j == this.ListBox2.Items.Count - 1) //不存在
{
this.ListBox2.Items.Add(this.ListBox1.Items[i]); //选中项写入listbox2中
this.ListBox2.Items[ListBox2.Items.Count - 1].Selected = false;
}
}
}
}
}
{
if (this.ListBox1.Items[i].Selected == true)
{
if (this.ListBox2.Items.Count == 0) { this.ListBox2.Items.Add(ListBox1.Items[i]); } // listbox2中没有数据
else
{
for (int j = 0; j < this.ListBox2.Items.Count; j++)
{
//listbox中是否已存在
if (ListBox2.Items[j].Text.ToString().Equals(ListBox1.Items[i].Text.ToString()))
{
break; //跳出本次循环
}
if (j == this.ListBox2.Items.Count - 1) //不存在
{
this.ListBox2.Items.Add(this.ListBox1.Items[i]); //选中项写入listbox2中
this.ListBox2.Items[ListBox2.Items.Count - 1].Selected = false;
}
}
}
}
}
- listbox1添加到listbox2中处理
- 将ListBox1的内容添加到ListBox2.
- listbox1中内容加到listbox2中
- ListBox1控件单击选中后自动添加至另一个ListBox2中。
- WinForm 如何把listBox1中选择的多项传到listBox2中
- ANDROID中按键的添加配置(linux按键到android处理)
- hibernate添加到MyEclipse中....
- 添加数据到图表中
- 添加app到系统中
- AChartEngine添加到View中
- tomcat添加到eclipse中
- list添加到dataframe中
- ListBox1删除操作
- listBox1.InvokeRequired学习
- C# listBox1 总结
- vs2008 c++中添加消息处理函数
- UITableView中添加UIButton按钮处理
- 将控件添加到GAC中
- U-BOOT NAND FLASH bad block 管理测试记录
- django防止页面重新载入,刷新重复提交表单解决方案
- ARM基础知识(一)
- #Knitr# Knitr-Options
- 10/5 复习以前知识
- listbox1添加到listbox2中处理
- Android中的组件外观设置(dp or px)
- Lua 协程
- memcache集群使用原则
- eclipse.ini/myeclipse.ini中配置参数 -Xms,-Xmx,-PerSize
- 想做测试,有前途吗,该如何去做?
- ios消息推送机制原理与实现
- C#中Split分隔字符串的应用(C#、split、分隔、字符串)
- android常见的异常错误