Can anybody tell me how to drag images between child forms of a MDI application?

  • Thread starter Thread starter Ajay Kumar
  • Start date Start date
A

Ajay Kumar

Can anybody tell me how to drag images between child forms of a MDI
application?
 
It is not clear what you want to do - are you trying to drag a list of image
filenames from one form to another? Or drag images from a PictureBox on one
form to a PictureBox on another form? Or just grab an arbitrary part of the
form and drag it to a part of another form?

If it is either of the first 2, you just need to follow the standard drag &
drop process.
On the "source" control (PictureBox), handle the MouseDown event and call
the DoDragDrop method, passing in the data (the Image) you want to transfer.
On the "target" control, you need to handle the following events, at a
minimum:
(I assume these events receive a DragEventArgs argument named 'e')

DragEnter - call e.Data.GetDataPresent(supportedFormat) and set the e.Effect
you will support.

DragDrop - call e.Data.GetData(supportedFormat) and do something with the
data you recieve.

Read the documentation for these events/methods and you should be on your way.
Hope this helps.

Joshua Flanagan
http://flimflan.com/blog
 

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

Back
Top