Home All Groups Group Topic Archive Search About

Dragging and dropping onto a form with many controls

Author
28 Nov 2006 2:52 PM
Mark Ingram
Hi, I want to be able to drag and drop some files onto my application
but it is only possible to drop at a location where I have no child
controls.

e.g. If i have a form with a textbox on it, I want to be able to drop
the files anywhere, but currently I can't drop them on to the textbox
itself. Is there a quick way I can get around this (I *dont* want to add
in the drag / drop code for all the controls on my form - as i have far
too many).

Any help much appreciated,

Thanks

Author
28 Nov 2006 10:12 PM
Gozirra
Couldn't you simply wire up the same eventhandler for all of your child
controls.  This way you could use the same code to handle the drop.
You could loop through all of controls and wire up the events on the
fly.  Just a suggestion although I will admit that this is not an area
I have a lot of experience with.

Mark Ingram wrote:
Show quote
> Hi, I want to be able to drag and drop some files onto my application
> but it is only possible to drop at a location where I have no child
> controls.
>
> e.g. If i have a form with a textbox on it, I want to be able to drop
> the files anywhere, but currently I can't drop them on to the textbox
> itself. Is there a quick way I can get around this (I *dont* want to add
> in the drag / drop code for all the controls on my form - as i have far
> too many).
>
> Any help much appreciated,
>
> Thanks
Author
29 Nov 2006 2:32 PM
Mark Ingram
Gozirra wrote:
> Couldn't you simply wire up the same eventhandler for all of your child
> controls.  This way you could use the same code to handle the drop.
> You could loop through all of controls and wire up the events on the
> fly.  Just a suggestion although I will admit that this is not an area
> I have a lot of experience with.

>

Yeah, that's what I've had to do, I was hoping for a smoother method
than that :-/

Cheers,

AddThis Social Bookmark Button