[Overview][Constants][Classes][Procedures and functions][Index] | Reference for unit 'ExtDlgs' (#lcl)

# TCalendarDialog

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TCalendarDialog - a popup calendar dialog that allows a date to be selected and returned to the main program.

## Declaration

Source position: extdlgs.pas line 196

`type TCalendarDialog = class(TExtCommonDialog)`
`protected`
`class procedure WSRegisterClass; override;` |  | Registers this component class with the current WidgetSet.
`procedure GetNewDate();` |  | Gets the date value from the Calendar on the dialog form.
`procedure CalendarDblClick();` |  | Implements the event handler signalled for a double click on the calendar control in the dialog.
`function DefaultTitle; override;` |  | Gets the default value for the Title property used as the Caption for the calendar dialog form.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`function Execute; override;` |  | Creates and displays the form for the calendar dialog, and captures the results.
`property Left: Integer; [rw]` |  | Contains the left coordinate for the dialog.
`property Top: Integer; [rw]` |  | Contains the top coordinate for the dialog.
`published`
`property Date: TDateTime; [rw]` |  | The selected Date for the calendar dialog.
`property DisplaySettings: TDisplaySettings; [rw]` |  | The user-specified settings determining the appearance of the calendar on the dialog.
`property FirstDayOfWeek: TCalDayOfWeek; [rw]` |  | Indicates the day of the week used in the first column for the calendar control on the dialog.
`property OKCaption: TCaption; [rw]` |  | Caption displayed on the OK button.
`property CancelCaption: TCaption; [rw]` |  | Caption displayed on the Cancel button for the calendar dialog form.
`property OnDayChanged: TNotifyEvent; [rw]` |  | Event handler signalled when the day number in Date has been changed.
`property OnMonthChanged: TNotifyEvent; [rw]` |  | Event handler signalled when a month number in Date has been changed.
`property OnYearChanged: TNotifyEvent; [rw]` |  | Event handler signalled when the year number in Date has been changed.
`property OnChange: TNotifyEvent; [rw]` |  | Event handler signalled when the value in Date has been changed.
`end;`

## Inheritance

`TCalendarDialog` |  | TCalendarDialog - a popup calendar dialog that allows a date to be selected and returned to the main program.
`TExtCommonDialog` |  | The common base class for custom drawn dialogs (Calculator and Calendar).
`TCommonDialog` |  | The base type from which other dialogs are derived.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

TCalendarDialog is a TExtCommonDialog descendant which implements a calendar dialog used to select a date from a TCalendar control. It provides a Date property that contains the date used when selecting a date using the Calendar control displayed in the dialog.

TCalendarDialog creates and configures a TForm instance that is displayed in the Execute method for the dialog. The form uses the Title, DialogPosition, DisplaySettings, and Date properties assigned in the class. A new TCalendar control is created for the form, and stored in the Calendar property. Methods which implement the event handlers for the calendar control are also assigned. The form instance is displayed modally, and the modal result is captured in the UserChoice property. Date is updated when a calendar date is selected while the form is active.

## See also

TExtCommonDialog |  | The common base class for custom drawn dialogs (Calculator and Calendar).
TCalendarDialog.Date |  | The selected Date for the calendar dialog.
TExtCommonDialog.DialogPosition |  | Specifies the position where the dialog is displayed.
TExtCommonDialog.DlgForm |  | Contains the form displayed modally for the custom-drawn dialog.
TCalendarDialog.Execute |  | Creates and displays the form for the calendar dialog, and captures the results.
TCalendar |  | TCalendar allows selection of a date from a calendar display.