Private Sub ToolCopyRight_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolCopyRight.Click
Dim I As Integer = 0
If lvwLeftList.Items.Count > 0 Then
Do While I <= lvwLeftList.Items.Count
Try
If lvwLeftList.Items.Item(I).Selected = True Then
lvwLeftList.Items.Item(I).ImageIndex = 1
Dim SelItem As String = lvwLeftList.Items.Item(I).Text
If cmboLeft.Text.Length > 3 Then
Dim FullPathLeft As String = cmboLeft.Text & "\" & SelItem
Dim FullPathRight As String = cmboRight.Text & "\" & SelItem
Dim ListRight As New ListViewItem
FileCopy(FullPathLeft, FullPathRight)
Me.ToolStripStatusRightShown.Text = "Files: " & lvwRightList.Items.Count + 1
Dim returnValue As ListViewItem = lvwRightList.FindItemWithText(SelItem)
If (returnValue Is Nothing) Then
'Do While I < lvwLeftList.SelectedItems.Count
Dim tmpItem As ListViewItem = CType(lvwLeftList.SelectedItems(I).Clone(), ListViewItem)
lvwRightList.Items.Add(tmpItem)
'I += 1
'Loop
lvwRightList.FindItemWithText(SelItem).ImageIndex = 1
Else
lvwRightList.FindItemWithText(SelItem).ImageIndex = 1
End If
Dim RightListCount As Integer
RightListCount = lvwRightList.Items.Count
For Each ListRight In lvwRightList.Items
If ListRight.ImageIndex = -1 Then
ListRight.ImageIndex = 1
End If
Next
Else
Dim FullPathLeft As String = cmboLeft.Text & SelItem
Dim FullPathRight As String = cmboRight.Text & SelItem
Dim ListRight As New ListViewItem
FileCopy(FullPathLeft, FullPathRight)
Me.ToolStripStatusRightShown.Text = "Files: " & lvwRightList.Items.Count + 1
Dim returnValue As ListViewItem = lvwRightList.FindItemWithText(SelItem)
If (returnValue Is Nothing) Then
'Do While I < lvwLeftList.SelectedItems.Count
Dim tmpItem As ListViewItem = CType(lvwLeftList.SelectedItems(I).Clone(), ListViewItem)
lvwRightList.Items.Add(tmpItem)
'I += 1
'Loop
lvwRightList.FindItemWithText(SelItem).ImageIndex = 1
End If
Dim RightListCount As Integer
RightListCount = lvwRightList.Items.Count
For Each ListRight In lvwRightList.Items
If ListRight.ImageIndex = -1 Then
ListRight.ImageIndex = 1
End If
Next
End If
End If
Catch ex As Exception
End Try
I = I + 1
Loop
lvwLeftList.SelectedItems.Clear()
End If
End Sub