HeaderPane
Main
Hide
Share Link
Print

Calendar Layout and Views

Multiple Months

The MonthsAcross and MonthsDown properties of the SftDateCalendar object, returned by the Calendar property of a month calendar control and the Calendar property of a date field control, define how many months a calendar shows side by side and one below the other, from 1 to 12 each. The previous and next buttons scroll by the number of months shown, or by the number defined by the ScrollMonths property; the mouse wheel scrolls by one month, or by the number defined by ScrollMonths.

sftCalendar1.Calendar.MonthsAcross = 3;
sftCalendar1.Calendar.MonthsDown = 2;

In a month calendar control (SftCalendar), the DisplayStart property defines the first month shown, and the FirstDisplayedDate and LastDisplayedDate properties return the first and the last date shown, including the days of the previous and next month when they are shown. The ScrollIntoView method scrolls the calendar so a date is shown, the Scroll method scrolls it by a number of months (years, decades or centuries in the larger views), and the DisplayChanged event occurs when it shows other months. The FocusedDate property defines the date that has the keyboard focus.

sftCalendar1.ScrollIntoView(new DateTime(2027, 7, 4));

Views

Besides the days of a month, a calendar can show the months of a year, the years of a decade and the decades of a century. Clicking a title or pressing Ctrl+Up switches to the next larger view; choosing a month, a year or a decade, or pressing Ctrl+Down, switches back to the next smaller one.

MonthYear
DecadeCentury

In a month calendar control, the View property switches to a view (viewSftDateMonth, viewSftDateYear, viewSftDateDecade or viewSftDateCentury) and returns the current one, and the ViewChanged event occurs when it changes. The InitialView property defines the view a calendar starts with, also each time a field's dropdown opens, and the AllowedViews property the views the user can switch to, a combination of viewsSftDateMonth, viewsSftDateYear, viewsSftDateDecade and viewsSftDateCentury (viewsSftDateAll by default).

sftDate1.Calendar.AllowedViews = SftDateViewsConstants.viewsSftDateYear | SftDateViewsConstants.viewsSftDateDecade;

A calendar without the month view selects months: choosing a month in the year view selects its first day, so the field above is a month picker. Calendars with several eras, such as the Japanese calendar, offer the month and year views only.

Size

With the AutoSize property (CtlAutoSize in Windows Forms) set to True (the default), a month calendar control sizes itself to show all its months; the Font and TitleFont properties of the calendar define the fonts of the days and of the titles, and with them the size of the calendar. Without a calendar font, the calendar uses the control's font (Font, or Font for the dropdown calendar of a date field control); without a title font, the bold version of the calendar font. The SingleMonthWidth and SingleMonthHeight properties return the size of a month calendar control showing one month, the PreferredWidth and PreferredHeight properties the size it needs for all its months.


Last Updated 11/29/2026 - (email)
© 2026 Softel vdm, Inc.