Winforms CustomControl Hit Test
I'm developing a custom control which renders all its content via OnPaint.
The content is lines, rectangles and images.

I need to support click and drag of some of the elements and custom tool tip according to the location of the mouse.
Currently, I'm running in brute force over all elements for each click.

I want to optimize this behavior, can anyone please suggest for better methods for doing the hit test?

Thanks.
Winforms CustomControl Hit Test
===

I'm developing a custom control which renders all its content via OnPaint.
The content is lines, rectangles and images.

I need to support click and drag of some of the elements and custom tool tip according to the location of the mouse.
Currently, I'm running in brute force over all elements for each click.

I want to optimize this behavior, can anyone please suggest for better methods for doing the hit test?

Thanks.