There is a list View + a PopUpMenu. I need that the PopUpMenu appears when items are present. The menu must not appears when 0 items.
Is this approximate code appropriate (can be used as a basis)?
procedure TForm1.StringGrid1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var P: TPoint;
begin
P:=GetClientOrigin;
if Button = mbRight then
PopupMenu1.Popup(X+P.X+StringGrid1.Left, Y+P.Y+StringGrid1.Top);
end;
Are there other ways?
Thanks!!!