Hola.
Algo que se me ocurrió es:
Código Delphi
[-]
type
TDBGridExt = class(TDBGrid);
procedure PosicionarForm(AGrid: TDBGrid; AFormClass: TFormClass);
var
i,L: Integer;
P: TPoint;
begin
with TDBGridExt(AGrid) do
begin
L:= ColWidths[0];
for i:= 1 to Col-1 do L:= L + ColWidths[i];
P.X:= L + 4; P.Y:= RowHeights[0] + Row * DefaultRowHeight + 4;
P:= ClientToScreen(P);
with AFormClass.Create(Application) do
try
Left:= P.X;
Top:= P.Y;
ShowModal;
finally
Free;
end;
end;
end;
Llamada:
Código Delphi
[-]
PosicionarForm(DBGrid1, TForm2);
Pero si hay una mejor manera de hacerlo, sin dudas que román la conocerá.
Un saludo.