블로그 이미지
생각처럼

카테고리

전체보기 (209)
TOOL (1)
다이어리 (1)
Bit (200)
HELP? (0)
Total
Today
Yesterday

달력

« » 2025.2
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28

공지사항

태그목록

최근에 올라온 글

VB ListView DragDrop

Bit / 2012. 2. 3. 17:40

 

속성설정에서 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

Posted by 생각처럼
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함