My point is I want to keep the calendar always on the months view, like this:
Expected TMonthCalendar view:
So that when I click in a month, instead of showing the days of the month, it stays in this screen and call the event.
My point is I want to keep the calendar always on the months view, like this:
Expected TMonthCalendar view:
So that when I click in a month, instead of showing the days of the month, it stays in this screen and call the event.
Copyright © 2021 Jogjafile Inc.

Prior to Vista, the underlying Win32 MonthCal control that
TMonthCalendarwraps has no concept of views at all, so you can't do what you are asking for in XP and earlier, unless you find a 3rd party calendar that supports what you want on those Windows versions.However, in Vista and later, the underlying MonthCal control is view-aware (but
TMonthCalendaritself is not). You can manually send aMCM_SETCURRENTVIEWmessage to theTMonthCalendar'sHWNDto set its initial view toMCMV_YEAR, and subclass itsWindowProcproperty to interceptCN_NOTIFYmessages (the VCL's wrapper forWM_NOTIFY) looking for theMCN_VIEWCHANGEnotification when the user changes the active view. You can't lock the control to a specific view, but you can react to when the user changes the active view from the Year view to the Month view, and then you can reset the calendar back to the Year view if needed.For example:
If you are using C++Builder 10.1 Berlin or later, look at the newer
TCalendarViewandTCalendarPickercomponents. They both have aDisplayModeproperty that you can set toTDisplayMode::dmYearfor the current view, and anOn(Calendar)ChangeViewevent to react to view changes by the user.