Hi all,
A quick question:
How do I get the name of the (topmost?) control at the cursor position?
The background: I implemented drag'n'drop from a dgv to a label and need to identify the control where the mouse button is released. I have enabled dropping on the label where the drop is going to take place. However, this label is the parent of say a hundred labels that are created dynamically in codebehind (I use this way to create a "dataview"). Therefore, I need to know which of these "child" labels the user drops the data onto.
I can get the mouseposition without problems (Me.PointToClient(Cursor.Position).ToString), but as I said, I can't get the name/text/ID of the control the user dropped the data on. Also, I ned to get the child control's name/ID/Text, not the parent label of course.
In addition, it seems as if I can't select the row I click on in the dgv anymore, after I implemented the DoDragDrop on the CellMouseDown event. Any ideas? Should I use another event?
Thanks a lot for any assistance!
Pettrer
A quick question:
How do I get the name of the (topmost?) control at the cursor position?
The background: I implemented drag'n'drop from a dgv to a label and need to identify the control where the mouse button is released. I have enabled dropping on the label where the drop is going to take place. However, this label is the parent of say a hundred labels that are created dynamically in codebehind (I use this way to create a "dataview"). Therefore, I need to know which of these "child" labels the user drops the data onto.
I can get the mouseposition without problems (Me.PointToClient(Cursor.Position).ToString), but as I said, I can't get the name/text/ID of the control the user dropped the data on. Also, I ned to get the child control's name/ID/Text, not the parent label of course.
In addition, it seems as if I can't select the row I click on in the dgv anymore, after I implemented the DoDragDrop on the CellMouseDown event. Any ideas? Should I use another event?
Thanks a lot for any assistance!
Pettrer