1. Visual Basic.Net

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 Visual Basic.

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
Comments to: Drag And Drop File ke listbox

    Your email address will not be published. Required fields are marked *

    Attach images - Only PNG, JPG, JPEG and GIF are supported.