c# Dynamically generated controls issue.
- by Thomas
Good Day
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)