且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2023-02-10 14:53:52

此链接可以为您提供帮助!
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