C# Drag and Drop sample

I need to implement drag and drop between two MDI child forms. If somebody wants to paste sample code, it can include two different MDI child forms of different classes. MDI parent contains one instance of each type. Let's say that dragging starts in one form and finishes in another.  When information is dropped, destination form can show coordinates where dragging was started.
This is simple and close to desired scenario for my program.
LVL 48
AlexFMAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

vo1dCommented:
what do you want to drag and drop?
0
AlexFMAuthor Commented:
Source form contains image thumbnails. Destination page contains cells which can accept image or images. User can select one or more thumbnails on the source page, drag them to destination form and drop to free cell. Images are written to free cells starting from this free cell.
I don't have implementation details yet, because both these forms are not written. Therefore, I need to see a way to pass any information from one form to another, which may be, for example, source point coordinates, or anything else.
I want to know also how to set cursor when it is dragged over areas allowed and not allowed for dropping.
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
Hey AlexFM...

See here for the "big picture":
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21825093.html

Basically you set the AllowDrop() property for whatever you want to receive things.  Then in the DragEnter() event, you test the data being sent to see if it is a format you want to receive.  If so, you set the e.Effect parameter accordingly.  I created my own DataObject class to handle this situation so I know exactly what is being dropped and I can use that to base my decision upon.  You can add whatever you want to that class so you could hold multiple things in it.  Finally in the DragDrop() event you pull the data object out and do something with it...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AlexFMAuthor Commented:
Great, this is good start point.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.