Results 1 to 2 of 2

Thread: help with Dragging

  1. #1

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    help with Dragging

    hi guys! how can I get the path of the folder that is dragged to my listbox?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: help with Dragging

    In the DragDrop event handler the dragged data is returned to you through the e.Data property, which is type IDataObject. You are interested in the GetFormats and GetData methods of that IDataObject object. Call GetFormats and it will tell you what formats the data can be retrieved in. Once you know the available formats you can call GetData to get the data in those formats. Do that and see what you get with each format and then make a choice as to which is most useful to you and go with that.

    Now remember that if your ListBox is a valid drop target then you need to use the DragEnter event to exclude any data that is not of a type that you want your ListBox to accept.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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