Drag file onto form to open file

/ Published in: C#
Save to your folder(s)

Example written 01/13/2011

The following code shows how to implement functionality in your Windows Forms application, such that you'll be able to open a file that is dragged and dropped onto your program's form. This behavior is often desirable for programs that manipulate files in some way (renamers, encrypters, etc.) It's also nice for the uer to be able to have more than one way to open a file. This example implements opening via drag-dropping, and via a customary File->Open menu.

URL: http://kyrathaba.dcmembers.com/errata/openFileDroppedOntoForm.htm

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.