Drag And Drop File ke listbox

- December 28, 2011
0 (0 votes)
Rate :
Drag And Drop File ke listbox

Artikel ini merupakan potongan kode program untuk men-drag file dari Windows Explorer kemudian men-drop-nya di listbox .

buat Form baru dengan sebuah kontrol Listbox (OLEDropMode=Manual) didalamnya. lalu tuliskan kode berikut ini :

Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
    For i = 1 To Data.Files.Count
        List1.AddItem Data.Files(i)
    Next i
End Sub

Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter

– Eric S. Raymond

Have a better explanation?

If you have comments about this post. Please write your comments below

No comments associated with this article