Ver Mensaje Individual
  #4  
Antiguo 30-12-2017
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
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
  // (quité el case ya que no se necesita para la prueba)
  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
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita