Implementing Drag/Drop onto empty MDI Document Area

Docking/MDI for Windows Forms Forum

Posted 14 years ago by Marianne
Avatar
When nothing is in a tabbed MDI area I would like to be able to drag a file onto the surface of it and respond via standard OLE drag/drop. My attempts so far have failed and I looked in the sample app but don't see it implemented in there either. What I'm doing is:
            dm.TabbedMdiRootContainer.AllowDrop = true;
            dm.TabbedMdiRootContainer.DragDrop += new DragEventHandler(TabbedMdiRootContainer_DragDrop);
            
I'm assuming that the TabbedMdiRootContainer is what I want to use but am not entirely positive. Please advise.

------------------------------- Marianne

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
All you're missing is a DragOver handler. You need to set its event arg's Effect in that. I was able to do drag/drop after adding that.


Actipro Software Support

Posted 14 years ago by Boyd - Automated Software Testing Consultant / Developer, Patterson Consulting, LLC
Avatar
It would be more efficient to use the 'DragEnter' event instead of 'DragOver', and it will work the same. DragEnter will only be fired once when the cursor moves over the control, while DragOver constantly fires as the mouse moves.

You would only want to use DragOver if you needed to respond differently for different areas within your control.

Just thought I'd throw that in :)
The latest build of this product (v2020.1 build 0400) was released 9 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.