I have a drag-and-drop event handler registered to a parent form,
this.DragDrop += new DragEventHandler(Form_DragDrop);
There are several child form that are derived from the parent form. However, when I drag an item inside the forms, the action is only valid if there are no other components in 开发者_如何学Gothat area.
I would like the drag-and-drop action to be valid in ALL areas of the form, including buttons, textboxes, etc. Is there anyway to specify some sort of overriding behavior inside the parents form?
You will have to implement the D+D events on all the controls. Not exactly practical, but you could do so by iterating the Form.Controls collection recursively. Give the user a good drop target, makes it easier for her to guess where to drop, easier for you to implement the code.
精彩评论