I got a Panel
and inside it some drag and drop operations of custom controls, when the dragging begins I do panel.Capture = True;
for the panel to fire the proper events even when the user releases the left mouse button outside the panel bounds (e.g.: panel_DragDrop
) but the DragDrop
event isn't getting fired unless the left mouse button is released while the cursor is located within the bounds of the panel.
I thought panel.Capture
would solve this but it's not doing any effect. Any ideas what am I missing here?
Edit: Ok I think I know what I have to do now. I think I had a misunderstanding of the DragDrop event. What I have in my application is dragging of controls inside the panel only ( think of it as moving blocks ), while the user is dragging a block and goes out of bounds, I auto scroll, if the cursor goes outside the panel, the panel_DragDrop
never gets called and the placement of the block doesn't take place if the mouse gets released. I think my solution is this:
Cursor.Clip = panelDiagram.RectangleToScreen(panelDiagram.ClientRectangle);
This will make the cursor bound to the panel boundaries while dragging, so no way to take the cursor off bounds.
Sorry for any troubles