Using the Graphics class and a panel, I can draw a geometric shape onto a Form. I understood that i cannot apply events to this shape (like click, drag etc.).
How can i create a geometric shape (perhaps using Points) to which I can apply events, for instance to allow the shape to be moved by dragging and dropping?
If you attach event handlers directly to the Panel on which you are drawing these shapes, you can use them to determine where the user is hovering the mouse, where they clicked, if they’re dragging, etc. You can determine if the user is clicking on a vertex of points (perhaps allowing them to change the shape) or within a set of points defining a polygon (perhaps allowing them to move it). You can then make the necessary changes to an array of Points defining that shape based on the user’s mouse “gestures”, that are then used to redraw the shape on the next window Paint().
As a succinct answer to “how can I know which shape was clicked”, implement a “point in polygon” test; given a set of points defining a polygon M and a point P which may or may not be inside M, find a point Q guaranteed to be outside the shape you want to test, draw an imaginary line PQ between P and Q, and count how many line segments of M that PQ crosses. If that number is odd, P lies within M.