Fabian1648 2 Posted March 12, 2021 Hi, In an Delphi Rio FMX app, how can we get the name of the control if we click on it? In a VCL, we can use: ctrl := FindVCLWindow(Mouse.CursorPos) ; ShowMessage(ctrl.Name); Is there a similar approach for FMX? Share this post Link to post
KodeZwerg 54 Posted March 12, 2021 8 minutes ago, Fabian1648 said: Hi, In an Delphi Rio FMX app, how can we get the name of the control if we click on it? In a VCL, we can use: ctrl := FindVCLWindow(Mouse.CursorPos) ; ShowMessage(ctrl.Name); Is there a similar approach for FMX? ObjectAtPoint should be what you searching for. Share this post Link to post
Remy Lebeau 1395 Posted March 13, 2021 (edited) Why are you simply not using the Sender of the click event? procedure TMyForm.MyControlClick(Sender: TObject); begin ShowMessage(TControl(Sender).Name); end; Edited March 13, 2021 by Remy Lebeau 2 Share this post Link to post