Ver Mensaje Individual
  #6  
Antiguo 06-09-2005
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Hola,

Veo que StringReplace al parecer no da el ancho. Buscando por ahí he visto esta solución:

Código Delphi [-]
var
  Start: Integer;

begin
  Start := RichEdit1.FindText(FindText, 0, Length(RichEdit1.Text), []);
  if Start <> -1 then
  begin
    RichEdit1.SelStart := Start;
    RichEdit1.SelLength := Length(FindText);
    RichEdit1.SelText := ReplaceText;
  end;
end;

donde FindText es el texto a buscar y ReplaceText el texto para reemplazar.

Lo que esto hace es usar el método FindText del RichEdit para encontrar el texto, lo selecciona y lo reemplaza usando SelText.

// Saludos
Responder Con Cita