FMX Right-click on the menu out and displayed in the current below

FMX Right-click on the menu out and displayed in the current below

 

procedure TForm1.btn6MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
var
LP: TPointF;
begin
LP := btn6.LocalToAbsolute(TPointF.Create(btn6.Width / 2, btn6.Height / 2 ));
LP := btn6.Scene.LocalToScreen(lP);
btn6.PopupMenu.PopupComponent := btn6;
btn6.PopupMenu.Popup(Round(LP.X), Round(LP.Y));
end;

 

Guess you like

Origin www.cnblogs.com/pykill/p/11326526.html