{
Font, Execute, OnApply, Assign example
This example takes an edit control, a button, and a rich edit control on a form.  When the user presses the button, a Font dialog appears.  When the user clicks the Apply button in the Font dialog, the currently selected font is applied to the active control. 
} 
procedure TForm1.Button1Click(Sender: TObject);
begin
   TFontDialog1.Options = TFontDialog1.Options + fdApplyButton;
   TFontDialog1.Execute;
end;
procedure TForm1.FontDialog1Apply(Sender: TObject; Wnd: Integer);
begin
  if ActiveControl is TEdit then
    with ActiveControl as TEdit do
       Font.Assign(TFontDialog(Sender).Font)
  else if ActiveControl is TRichEdit then
    with ActiveControl as TRichEdit do
      SelAttributes.Assign(TFontDialog(Sender).Font)
  else
    Beep;
end; 
