I have a form where my user will pick a year from a numeric up-down, and that will restrict the month calendar to December of that year. This makes the year, decade etc views of the calendar pointless, and I want to disable clicking on the month title to get to this view.
I have tried using the min and max values for the calendar, and while this disabled the month left and right buttons, I can still click on the month title, and it ends up looking like this: result of clicking on month title.
There also does not seem to be a calendar mode property/attribute to handle or a title click event.
Apologies if I have missed something obvious, I am pretty inexperienced with WinForms.



You create you own calendar control deriving from
MonthCalendarand then intercept the low-level messages sent to the control to suppress mouse events.More specifically, you can suppress the WM_LBUTTONDOWN event from happening when title background is being clicked.
Note that once you have compiled this code, this control will appear in the controls toolbox and you can drag and drop it to your form.
Alternatively, you can close the form designer and save the form. Then open
yourForm.Designer.cswhereyourFormis the name of your form. In there replaceMonthCalendarbyRestrictedMonthCalendar(it appears twice) and save.