VB ListView DragDrop
속성설정에서 AllowDrop True 설정
이벤트는
ItemDrag = 이벤트 시작
DragEnter = 내부영역 이동시
DragDrop = 드래그드랍 사용자 정의
Public Class Form1
Private Sub ListView1_ItemDrag(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles ListView1.ItemDrag
ListView1.DoDragDrop(ListView1.SelectedItems, DragDropEffects.Copy Or DragDropEffects.Move)
End Sub
Private Sub ListView1_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListView1.DragDrop
Dim Items As ListView.SelectedListViewItemCollection = e.Data.GetData(GetType(ListView.SelectedListViewItemCollection))
Dim child As ListViewItem
For Each child In Items
ListView1.Items.Add(child.Clone())
child.Remove()
Next
End Sub
Private Sub ListView1_DragEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListView1.DragEnter
e.Effect = DragDropEffects.Copy
End Sub
End Class