Drag & Drop Listview Item Löschen

  • VB.NET
  • .NET (FX) 4.0

Es gibt 1 Antwort in diesem Thema. Der letzte Beitrag () ist von ErfinderDesRades.

    Drag & Drop Listview Item Löschen

    Hey leute :)
    Ich arbeite an einer Drag and Drop Funktion mit einer Listview.
    Folgene Problem wie Kriege ich den item gelöscht. mit meiner Methode funktioniert das nicht. Bitte um Hilfe.
    Danke im voraus MFG :)


    VB.NET-Quellcode

    1. Try
    2. Dim StrTemp As String = ""
    3. Dim MyItemsCount As Integer = 0
    4. MyItemsCount = 0
    5. If ListView1.Items.Count = 0 Then
    6. MyItemsCount = 1
    7. End If
    8. If m_BinMousDown = True Then
    9. For Each Item As ListViewItem In ListView1.SelectedItems
    10. Dim FileInfo As New FileInfo(Item.Text)
    11. Dim Eintrag = PapertosListView.Items.Add(FileInfo.Name)
    12. Eintrag.ImageIndex = ImageList1.Images.Count = 0
    13. StrTemp = Item.SubItems(2).Text
    14. Item.Remove()
    15. Next
    16. PapertosListView.DoDragDrop(StrTemp, DragDropEffects.Copy)
    17. m_BinMousDown = False
    18. End If
    19. Catch ex As Exception
    20. End Try