Re: Finding...


[ Delphi Tutorial ]

Posted by WAllison on August 29, 2003 at 13:57:58:

In Reply to: Finding... posted by Joey on August 23, 2003 at 21:52:22:

: I have a memo box and i want it so that say through out the paragraph it spots say "hello" how do i make it so it highlights that word and how do i make it so it finds thats word?

try something like this:

var
 i: integer;
begin
  i := Pos(SearchEdit.Text, Memo1.Text);
  if i > 0 then
   begin
    Memo1.SelStart := i - 1;
    Memo1.SelLength := Length(SearchEdit.Text);
   end;
end;


[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]