You need to create a shape the user can manipulate on a form, perhaps by dragging it, resizing it, or otherwise interacting with it.
Create a custom control, and override the painting logic to draw a shape. Assign your shape to the Control.Region property. You can then use this Region to perform hit testing, which is demonstrated in recipe 10-2.
How It Works
If you need to create a complex user interface that incorporates many custom-drawn elements, you need a way to track these elements and allow the user to interact with them. The easiest approach in .NET is to create a dedicated control by deriving a class from System.Windows.Forms.Control. You can then customize the way this control appears ...