#2
apull2022-02-13 20:29
|
你好
下面这段代码是ListView控件的数据复制,但每次只能复制一行,有哪位大哥可以帮忙修改为可以每次复制多行数据。
If ListView2.SelectedItems.Count <= 0 Then
Return
End If
Dim Linedetails As ListView.SelectedListViewItemCollection = Me.ListView2.SelectedItems
Dim item As ListViewItem
Dim itemarray(6) As String
For Each item In Linedetails
For i = 0 To item.SubItems.Count - 1
If i = 0 Then
ReDim itemarray(item.SubItems.Count)
End If
itemarray(i) = CStr(item.SubItems(i).Text)
Next
Next
With
.Clear()
.SetText(Join(itemarray, vbTab))
End With