unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls;

type
  TForm2 = class(TForm)
    FontDialog1: TFontDialog;
    lblFONT: TLabel;
    Panel2: TPanel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    procedure BitBtn2Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.BitBtn1Click(Sender: TObject);
begin
   Close();
end;

procedure TForm2.BitBtn2Click(Sender: TObject);
var
	f : TFont;
   
begin
	if FontDialog1.Execute() then
   begin
   	f := TFont.Create();

      f.Name  := FontDialog1.Font.Name;
      f.Size  := FontDialog1.Font.Size;
      f.Color := FontDialog1.Font.Color;

      lblFONT.Font := f;
      lblFONT.Invalidate();

   	FreeAndNil(f);
   end;
end;

end.

