Ver Mensaje Individual
  #2  
Antiguo 14-07-2006
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.142
Reputación: 36
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Parece que una solución puede ser:

Código Delphi [-]
RichEdit1.Perform(EM_SCROLLCARET, 0, 0);

En contexto podría quedar más o menos:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
const
  S = 'cadena-busqueda';

var
  posResultado: integer;

begin

  with RichEdit1 do
    posResultado := FindText(S, 0, Length(Text), []);

  if (posResultado <> -1) then
  begin
    with RichEdit1 do
    begin
      SetFocus;
      SelStart := posResultado;
      SelLength := Length(S);
      Perform(EM_SCROLLCARET, 0, 0);
    end;
  end;

end;
__________________
David Esperalta
www.decsoftutils.com
Responder Con Cita