Dynamically generated controls issue.

Posted by Thomas on Stack Overflow See other posts from Stack Overflow or by Thomas
Published on 2010-06-14T12:35:45Z Indexed on 2010/06/14 13:12 UTC
Read the original article Hit count: 182

Filed under:
|
|

I have a form with a panel docked in it. I then dynamically create 15 panels (named: panel_n) and 15 pictureboxes (named: picturebox_n) on the primary panel (named ContainerPanel).

When dragging the any picturebox over a panel (panel_n) created using the relevant mouse events. I would like to get the panel's name that the picture box was dragged over. The mouse cursor seems to be captured.

I have tried creating a IMessageFilter interface, but there are still no events that trigger when dragging one of the pictureboxes over any one of the panels.

The ClientRectangle.IntersectsWith function also does not work as the co-ords are always 0,0.

All I need is the panel name where the picturebox was dragged over (preferably on the mouseup event)

© Stack Overflow or respective owner

Related posts about c#

Related posts about panel