unit MainUnit;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    ColorDialog1: TColorDialog;
    Button2: TButton;
    FontDialog1: TFontDialog;
    procedure FormPaint(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormPaint(Sender: TObject);
begin
 Canvas.Font.Color:=ColorDialog1.Color;
 Canvas.TextOut(60,100, 'Привет всем!!!');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
 if ColorDialog1.Execute then
  FormPaint(nil);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
 if FontDialog1.Execute then
  Canvas.Font:=FontDialog1.Font;
 Repaint;
end;

end.
