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

# ShowCalendarPopup

Creates, configures, and displays a TCalendarPopupForm instance.

## Declaration

Source position: calendarpopup.pas line 48

`procedure ShowCalendarPopup(`
`const APosition: TPoint;`
`ADate: TDateTime;`
`const CalendarDisplaySettings: TDisplaySettings;`
`AMinDate: TDateTime;`
`AMaxDate: TDateTime;`
`const OnReturnDate: TReturnDateEvent;`
`const OnShowHide: TNotifyEvent = Nil;`
`ACaller: TControl = Nil`
`); procedure ShowCalendarPopup(`
`const APosition: TPoint;`
`ADate: TDateTime;`
`const CalendarDisplaySettings: TDisplaySettings;`
`const OnReturnDate: TReturnDateEvent;`
`const OnShowHide: TNotifyEvent = Nil;`
`ACaller: TControl = Nil`
`);`

## Arguments

`APosition` |  | Coordinates where the pop-up calendar form is displayed.
`ADate` |  | Initial date displayed in the Calendar for the form.
`CalendarDisplaySettings` |  | Display settings applied to the Calendar control.
`AMinDate` |  | Minimum date value that can be displayed or selected using the Calendar on the dialog, or an empty value (0.0) when omitted.
`AMaxDate` |  | Minimum date value that can be displayed or selected using the Calendar on the dialog, or an empty value (0.0) when omitted.
`OnReturnDate` |  | Event handler signalled when a new date value is selected.
`OnShowHide` |  | Event handler signalled when the pop-up form is shown or hidden.
`ACaller` |  | The control which creates the pop-up and captures its return value.

## Arguments

`APosition` |  | Coordinates where the pop-up calendar form is displayed.
`ADate` |  | Initial date displayed in the Calendar for the form.
`CalendarDisplaySettings` |  | Display settings applied to the Calendar control.
`OnReturnDate` |  | Event handler signalled when a new date value is selected.
`OnShowHide` |  | Event handler signalled when the pop-up form is shown or hidden.
`ACaller` |  | The control which creates the pop-up and captures its return value.

## Description

ShowCalendarPopup is an overloaded procedure used to create, configure, and display a TCalendarPopupForm instance using the arguments passed to the routine. The argument values are stored to the TCalendar instance on the dialog form by calling the Initialize method.

ShowCalendarPopup calls the Show method in the form to make it visible. The KeepInView method in the form is called to ensure that the pop-up is fully visible on the current monitor.

ShowCalendarPopup is called from the ButtonClick method in TDateEdit. The caller sets the argument values, including the date range in AMinDate and AMaxDate, to the defaults needed for the control. AMinDate is set to the date value for September 14, 1752 (the start of the Gregorian calendar in England). AMaxDate is set to the date portion of the MaxDateTime constant in the RTL (December 31, 9999). When omitted, an empty TDateTime value (0.0) is used in the arguments and does not impose a date range for the calendar pop-up.

## Version info

Modified in LCL version 3.0 to include an overloaded variant with minimum and maximum date arguments.

## See also

TCalendarPopupForm |  | Implements a non-modal pop-up form used to select a date from a TCalendar control.
TReturnDateEvent |  | Specifies an event handler signalled when a date is selected on a pop-up calendar form.
TDisplaySettings |  | Set type for TDisplaySetting values.
TDateEdit.ButtonClick |  | Displays a pop-up calendar dialog when the Button for the grouped edit control is clicked.