CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Drag&Drop

  1. #1
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    150

    Drag&Drop

    How do I Drag & Drop a file (ie; New Text Document.txt) from the Desktop into my VB5 app and on the drop add the file to a directory or something ie; list box,picture box, whatever. Also can I make it so I can drag & Drop Pics and exe's too?

    Thankz, Drew
    [email protected]
    Thanks, Drew

  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: Drag&Drop


    option Explicit

    private Sub Form_Load()
    List1.OLEDragMode = 1
    List1.OLEDropMode = 1
    End Sub

    private Sub List1_OLEDragDrop(Data as DataObject, Effect as Long, Button as Integer, Shift as Integer, X as Single, Y as Single)
    Dim i as Integer
    for i = 1 to Data.Files.Count
    List1.AddItem Data.Files(i)
    next i
    End Sub





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

Featured