1
Move mouse to control (example a button) on Delphi with Firemonkey.
I tried this function:
procedure TFuncoes.MouseParaControle(Controle: TControl);
var // Posiciona o mouse em cima do objeto definido em
IrPara: TPoint; // Ex.: MouseParaControle(button1);
begin
IrPara.X := Controle.Position.X + (Controle.Size.width div 2); // ERRO
IrPara.Y := Controle.Position.y + (Controle.size.Height div 2);// ERRO
if Controle.Parent <> nil then
begin
IrPara := Controle.PointInObjectLocal(irPara.x, irPara.Y);
//Parent.ClientToScreen(IrPara);
SetCursorPos(IrPara.X, IrPara.Y);
end;
end;
ERROR:
[dcc32 Error] Trp.Model.Funcoes.pas(214): E2015 Operator not applicable to this operand type on the line
If I was able to help with my answer, you can accept the answer by clicking on the left side of it. If you need any more help let me know.
– Tmc