# Drag and Drop from File browser to Picturebox

Page 1 of 1

## 3 Replies - 3466 Views - Last Post: 18 May 2012 - 07:37 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=194611&amp;s=6f0a447bf22fa9ac9827412d75be8809&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 ANCChris

Reputation: 0
• Posts: 5
• Joined: 27-September 10

# Drag and Drop from File browser to Picturebox

Posted 12 October 2010 - 06:57 AM

Ok, here's the deal. I'm using a program where a picturebox(a picture of a desktop Inbox/Outbox) will be used to drag a file over to it, and drop it to a specific folder. That's the idea anyway, and I have NO IDEA how to do this. I've got the drag and drop in my file browser working, but I just don't know how to code the drop on the picturebox or even if it's possible to do what I'm trying to do. I like to think that anythings possible! haha but for me right now it's not.

Any ideas, code, or just a general direction to start in would be appreciated.

Is This A Good Question/Topic? 0

## Replies To: Drag and Drop from File browser to Picturebox

### #2 demausdauth

Reputation: 179
• Posts: 655
• Joined: 03-February 10

## Re: Drag and Drop from File browser to Picturebox

Posted 13 October 2010 - 11:19 AM

### #3 ANCChris

Reputation: 0
• Posts: 5
• Joined: 27-September 10

## Re: Drag and Drop from File browser to Picturebox

Posted 01 November 2010 - 07:45 AM

That would be awesome if I was dragging a picture to a picturebox. However, that is not the case. Let me clear this up a bit. Say there's a file browser on the right and a picturebox on the left. I want to take a file say SomeWordDoc.docx and drag it to the picturebox. When I release the mouse on the picture box, the file will save to a location on the hard drive specified by the picbox.

I've got the drag and drop part down, I just don't know how to get the picbox to save the word doc to a location.

Thanks,
Chris

### #4 aquahoya

Reputation: 0
• Posts: 59
• Joined: 08-January 12

## Re: Drag and Drop from File browser to Picturebox

Posted 18 May 2012 - 07:37 AM

ANCChris, on 01 November 2010 - 07:45 AM, said:

That would be awesome if I was dragging a picture to a picturebox. However, that is not the case. Let me clear this up a bit. Say there's a file browser on the right and a picturebox on the left. I want to take a file say SomeWordDoc.docx and drag it to the picturebox. When I release the mouse on the picture box, the file will save to a location on the hard drive specified by the picbox.

I've got the drag and drop part down, I just don't know how to get the picbox to save the word doc to a location.

Thanks,
Chris

I understand what you're trying to do I'm planning on doing something like this but a tad differently.
Take a look at http://msdn.microsof...y/sfezx97z.aspx and I'm assuming you already made the mouse release event. So look through the coding behind the link I gave you so "how to save files using SaveFiledialogue component".

or

You could save the file to a specific file location, using:
using(StreamWriter output = new StreamWriter("path\to\your\file")) {
provider.Export(document, output);
}



Hope I helped