Ted Carter
Ted Carter

Reputation: 1

How do I get mouse cursor position behind a control?

I am using C++Builder 10.3 and FMX.

There is a TImage control, on which multiple TRectangle controls are generated by some operation. The TRectangles are filled with claLightGray.

To get the mouse cursor position, I am using the OnMouseMove event for the TImage control. The problem is that I cannot get the mouse cursor position when the mouse moves into a TRectangle control on the TImage control.

How can I get the mouse cursor position for the TImage when it is on a TRectangle? I hope TRectangle is transparent to TImage in terms of mouse cursor position.

Upvotes: 0

Views: 67

Answers (1)

Tom Brunberg
Tom Brunberg

Reputation: 21033

You can achieve that by setting HitTest = False (it is True as default) on the rectangles.

Upvotes: 2

Related Questions