Hola.
Claro... pero habías solicitado mostrar el renglón.
Tal vez no esté interpretando bien tu planteo, pero si el StringGrid tiene dos columnas donde se almacenan las coordenadas X/Y del píxel, usando el ejemplo del mensaje
#2 podrias hacer:
Código Delphi
[-]
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
dx, dy, r : Integer;
sg: TStringGrid;
begin
sg := StringGrid1;
for r := 0 to StringGrid1.RowCount - 1 do
begin
dx := X - (StrToInt(StringGrid1.Cells[0, r]));
dy := Y - (strToInt(StringGrid1.Cells[1, r]));
if (abs(dx) < 5) and (abs(dy) < 5) then
begin
sg.Selection := TGridRect(Rect(0, r, sg.ColCount, r));
Label1.Caption := Format('Encontrado en columna: %d y fila: %d',[0, r]);
end;
end;
end;
donde se evidencia que el valor de la columna no se altera sea cual fuere el pìxel seleccionado.
Saludos