Results 1 to 4 of 4

Thread: [RESOLVED] drag and drop windows file icons into listbox

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    Resolved [RESOLVED] drag and drop windows file icons into listbox

    Has anyone done this in VB6? I want to be able to drag (a) file icon(s) from anywhere on the windows desktop to a listbox on a vb6 app form and have the full filepath(s) appear in the listbox.

    If anyone can point me to some example code or suggest an approach I would be grateful.

    Thanks!
    Last edited by Muddy; Jun 6th, 2006 at 11:58 AM. Reason: resolved

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: drag and drop windows file icons into listbox

    set the ListBox's OLEDropMode to 1-Manual, then:
    VB Code:
    1. Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.     Dim vFile As Variant
    3.     If Data.GetFormat(vbCFFiles) Then
    4.         For Each vFile In Data.Files
    5.             List1.AddItem vFile
    6.         Next vFile
    7.     End If
    8. End Sub

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    Re: drag and drop windows file icons into listbox

    Exactly what I need ... Very nice! Thanks!

    And I was imagining a complex API solution ...

  4. #4
    Lively Member
    Join Date
    May 2009
    Location
    EG
    Posts
    87

    Re: drag and drop windows file icons into listbox

    Thank you , you are beautiful

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width