{
Options example
The following code calls the user-defined routine DoReplace if the Replace button was clicked, or calls the user-defined routine DoReplaceAll if the Replace All button was clicked.
} 
procedure TForm1.ReplaceDialog1Replace(Sender: TObject);
begin
  with Sender as TReplaceDialog do
  begin
  if frReplace in Options then
    DoReplace(FindText, ReplaceText);
  else if frReplaceAll in Options then
    DoReplaceAll(FindText, ReplaceText);
end; 
