unit Main;

interface

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

type
  TMainForm = class(TForm)
    DateTimePicker1: TDateTimePicker;
    lblDATA1: TLabel;
    lblDATA2: TLabel;
    MonthCalendar1: TMonthCalendar;
    Panel2: TPanel;
    BitBtn1: TBitBtn;
    procedure FormShow(Sender: TObject);
    procedure DateTimePicker1Change(Sender: TObject);
    procedure MonthCalendar1Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainForm: TMainForm;

implementation

{$R *.dfm}

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

procedure TMainForm.DateTimePicker1Change(Sender: TObject);
begin
	lblDATA2.Caption := DateToStr(DateTimePicker1.Date);
end;

procedure TMainForm.FormCreate(Sender: TObject);
begin
	DateSeparator   := '-';
   LongDateFormat  := 'dd-MM-yyyy';
   ShortDateFormat := 'dd-MM-yyyy';
end;

procedure TMainForm.FormShow(Sender: TObject);
begin
	lblDATA1.Caption := DateToStr(MonthCalendar1.Date);
	lblDATA2.Caption := DateToStr(DateTimePicker1.Date);
end;

procedure TMainForm.MonthCalendar1Click(Sender: TObject);
begin
	lblDATA1.Caption := DateToStr(MonthCalendar1.Date);
end;

end.
