将Listview1 Column1移动/复制到另一个Listview2 Column5 [英] Move/Copy Listview1 Column1 to another Listview2 Column5

查看:105
本文介绍了将Listview1 Column1移动/复制到另一个Listview2 Column5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



是否可以将listtview1 [column1]复制/移动到listtview2 [column5]?


LISTVIEW1
第1栏|第2栏|第3列|第4列|第5栏
苹果
橙色
芒果
番石榴
葡萄

LISTVIEW2
第1列|第2栏|第3列|第4列| column5
____________________________________Apple
____________________________________橙色
____________________________________芒果
____________________________________番石榴
____________________________________ Grape

Hi,

It''s possible to copy/move listtview1[column1] to listtview2[column5]?


LISTVIEW1
column 1 | column 2 | column3 | column4 | column 5
Apple
Orange
Mango
Guava
Grape

LISTVIEW2
column1 | column 2 | column3 | column4 | column5
____________________________________Apple
____________________________________Orange
____________________________________Mango
____________________________________Guava
____________________________________Grape

推荐答案

简单.您必须读取所需行的ListViewItem中的值,并将这些值复制到每个ListViewItem的正确SubItem索引中.
Simple. You have to read the values in the ListViewItem for the rows you want and copy those values into the proper SubItem index for each ListViewItem.
Dim item As ListViewItem = ListView.Items(2)
item.SubItems(4).Text = item.Text


感谢您的答复,我感谢它现在可以工作...但是我想转移到另一个listview ...像listview 1 subitem(0)到lsitview 2 subitem( 1)...您能帮我吗?

thanks for your reply i appreciated it works for now... but i want to transfer to another listview...like listview 1 subitem(0) to lsitview 2 subitem(1)... could you please help me?

For i As Integer = 0 To ListView1.Items.Count - 1

           Dim item As ListViewItem = ListView1.Items(i)

           item.SubItems.Add(1).Text = item.Text

       Next


这篇关于将Listview1 Column1移动/复制到另一个Listview2 Column5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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