Dragn'drop between user controls

  • Thread starter Mats-Lennart Hansson
  • Start date
M

Mats-Lennart Hansson

Hi,
I've created a simple user control (System.Windows.Forms.UserControl) in c#.
Then I place two items of this control on a form. After this I try to drag
one control to the other and try to catch the OnDragEnter event. This
doesn't work.

My question is, how should I do this? If I try to drag a file from the file
explorer over my control the event is raised, but not if I drag my own
control.

Any help is highly appreciated.

Thanks,

Mats-Lennart
 
M

Mats-Lennart Hansson

For once I actually solved the problem on my own :)

To be able to drag a control, you must use the DoDragDrop method to
initialize the dragging.

/Mats-Lennart
 

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