acting as a drag source without using Windows Forms

A

Aamir

Hello,

If I have a graphic and I want to allow it to serve as drag source,
how do I do this?

Imagine that I want to drag from my application to Windows Explorer,
so that when I complete the drag-and-drop a file is copied to the
given directory. I know the way to do it if I'm using a Windows Form
is to implement DoDragDrop(), but what do I do if I am not?

I know I need to somehow create a DataObject, but then how do I ensure
that Windows uses this DataObject when it finishes the drag-and-drop
outside of my application?

Thanks so much for your help!
 
N

Nicholas Paldino [.NET/C# MVP]

Aamir,

Well, the graphic has to be hosted in something, right? You are
painting it yourself on a control or a form somewhere. ^That^ is what you
use as the drag source.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top