Delphi - FindDialog

 
Vista:

FindDialog

Publicado por el novato (28 intervenciones) el 29/04/2005 03:32:20
Hola amigos, quisiera saber que debo hacer para buscar en un memo a traves del FindDialog,

gracias de antemano
saludos a todos
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:FindDialog

Publicado por Elena (330 intervenciones) el 29/04/2005 14:25:48
En la ayuda de Delphi encontré esto...
procedure TForm1.Button1Click(Sender: TObject);

begin
FindDialog1.Position := Point(RichEdit1.Left + RichEdit1.Width, RichEdit1.Top);
FindDialog1.Execute;
end;

procedure TForm1.FindDialog1Find(Sender: TObject);
var
FoundAt: LongInt;
StartPos, ToEnd: Integer;
begin
with RichEdit1 do
begin
{ begin the search after the current selection if there is one }
{ otherwise, begin at the start of the text }
if SelLength <> 0 then

StartPos := SelStart + SelLength
else

StartPos := 0;

{ ToEnd is the length from StartPos to the end of the text in the rich edit control }

ToEnd := Length(Text) - StartPos;

FoundAt := FindText(FindDialog1.FindText, StartPos, ToEnd, [stMatchCase]);
if FoundAt <> -1 then
begin
SetFocus;
SelStart := FoundAt;
SelLength := Length(FindDialog1.FindText);
end;
end;
end;
Suerte...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar