5

I have a TGridLayout filled with some images in a Firemonkey HD Application. In the gridLayout's onMouseDown event I want to get the image object on which the user has clicked, but I have only mouse coordinates.

Implementing onMouseDown event for every image is not an option, because if an image is removed from the gridlayout an empty space remains. In this case I also want to know if the user has clicked in this empty area.

Is there a some kind of "getChildAtPos" or "FindVCLWindow" analog in Firemonkey?

Thanks!

iPath ツ
  • 2,468
  • 20
  • 31

2 Answers2

7

TForm.ObjectAtPoint should do the trick.

Uwe Raabe
  • 45,288
  • 3
  • 82
  • 130
0

FindVCLWindow does what you need. You need to specify the point at which the control is, in your case it's mouse position.

user1651105
  • 1,727
  • 4
  • 25
  • 45