如何将数据从选中的列表框传输到另一个选中的列表框 [英] How to transfer data from checked ListBox to another checked ListBox

查看:71
本文介绍了如何将数据从选中的列表框传输到另一个选中的列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将数据从一个选中的列表框传输到另一个选中的列表框?


[Digimans:取消了大写的喊叫声]
[BjörnRanft:已删除主题大喊]

How to transfer data from one checked list box to another checked list box ?


[Digimans: removed uppercase shouting]
[Björn Ranft: removed Subject shouting]

推荐答案

此链接可以为您提供帮助!
http://social.msdn.microsoft.com/Forums/zh-CN/vbgeneral/thread/a5c83bff-ba98-4a84-b8eb-c83dedf80228
This link can help You !
http://social.msdn.microsoft.com/Forums/en/vbgeneral/thread/a5c83bff-ba98-4a84-b8eb-c83dedf80228


查看此内容

http://www.dotnetcurry.com/ShowArticle.aspx?ID=183 [ ^ ]
check out this

http://www.dotnetcurry.com/ShowArticle.aspx?ID=183[^]


您好,
如果要将项目从一个复制到另一个复选框,则可以使用此方法:

Hello,
if you want to copy items from one to another checked list box you can use this :

int i = 0;
int k = 0;
i = checkedListBox1.Items.Count;
for (k = 0; k != i; k++)
{
 checkedListBox2.Items.Add(checkedListBox1.Items[k]);
}



在上面的示例中.您将项目从checkedListBox1复制到checkedListBox2,
因此它们将具有完全相同的复选框列表.如果要复制某些项目而不是全部项目,则需要通过声明项目索引来手动进行.



In the above exmpl. you copy items from checkedListBox1 to checkedListBox2,
so they will have exactly the same check box list. If you want to copy some of the items and not all , you need to do that manually by declaring the index of item.

checkedListBox2.Items.Add(checkedListBox1.Items[index]);



祝一切顺利,
PerićŽeljko



All the best,
Perić Željko


这篇关于如何将数据从选中的列表框传输到另一个选中的列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆