Marus Gradinaru
Marus Gradinaru

Reputation: 3022

Force TMonthCalendar to display user defined date format

By default TMonthCalendar shows date in the format that is set in Windows control panel (Short Date). I want to override this setting and force TMonthCalendar to always display my format regardless of Windows setting. Is it possible ?

Upvotes: 1

Views: 252

Answers (2)

SilverWarior
SilverWarior

Reputation: 8331

As far as I know, you can not change the date format settings of TMonthCalendar.

The reason for this is the fact that TMonthCalendar is actually just a wrapper around a calendar API from the OS. That is why not only is the date format in the form that is set in OS regional settings, but the whole look of the calendar matches the look of the OS on which you are running your application on.

So, I'm afraid you will have to look at some third party components for this. For instance, TMS Software has several calendar and date-time picking components as part of TPlannerCalendar.

Upvotes: 4

Sertac Akyuz
Sertac Akyuz

Reputation: 54802

No, this control is a wrapper for the native Month Calendar Control. As the documentation states:

The month-calendar control gets its format and all strings from LOCALE_USER_DEFAULT.

Upvotes: 3

Related Questions