2020年5月9日 星期六

VB.NET 把ListView的Item複製到ListViewItem裡 [Copy item from ListView to another Listview]


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
    Private Sub btnSortUp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSortUp.Click

        Dim tItem As ListViewItem

        Dim intItem As Integer = lvwSort.FocusedItem.Index

        tItem = lvwSort.Items(intItem - 1)

        lvwSort.Items(intItem - 1) = lvwSort.Items(intItem).Clone

        lvwSort.Items(intItem) = tItem.Clone

    End Sub

沒有留言:

張貼留言