HeaderPane
Main
Hide
Share Link
Print

MonthsAcross Property, SftDateCalendar Object

Defines the number of months shown side by side (1 to 12).

Syntax

Get

C#int Months = object.MonthsAcross;
VB.NETMonths = object.MonthsAcross As Integer
C++long Months = object->MonthsAcross;
long Months = object->GetMonthsAcross();
CHRESULT object->get_MonthsAcross(long* Months);

Put

C#int object.MonthsAcross = Months;
VB.NETobject.MonthsAcross = Months As Integer
C++long object->MonthsAcross = Months;
void object->PutMonthsAcross(long Months);
CHRESULT object->put_MonthsAcross(long Months);

object

A SftDateCalendar object.

Months

Defines the number of months shown side by side (1 to 12).

Comments

The MonthsAcross property defines the number of months a calendar shows side by side. The default is 1. MonthsDown defines the number of rows, so a calendar shows MonthsAcross times MonthsDown months. A value that is not between 1 and 12 causes an error. p A month calendar control that sizes itself (AutoSize, the default) takes the size of all months. The year, decade and century views show the same number of blocks, each covering a year, a decade or a century. p The setting applies to a month calendar control and to the dropdown calendar of a date field control.

Examples

C# View entire sample code

            comboHighContrast.SelectedIndex = (int)sftCalendar.HighContrastMode;
            comboButtons.Items.AddRange(new object[] { "Dropdown", "Up/down", "Dropdown, up/down", "None" });
            comboButtons.SelectedIndex = (int)fieldDate.Buttons;
            comboBorder.Items.AddRange(new object[] { "Single", "3D", "None" });
            comboBorder.SelectedIndex = Math.Max(0, Array.IndexOf(borderStyles, fieldDate.BorderStyle));
            comboAlignment.Items.AddRange(new object[] { "Near", "Far" });
            comboAlignment.SelectedIndex = (int)fieldDate.DropDownAlignment;
            comboAcross.Items.AddRange(new object[] { "1", "2", "3" });
            comboAcross.SelectedIndex = cal.MonthsAcross - 1;
            comboDown.Items.AddRange(new object[] { "1", "2" });
            comboDown.SelectedIndex = cal.MonthsDown - 1;
            comboWeekNumbers.Items.AddRange(new object[] { "None", "Culture rule", "ISO 8601" });
            comboWeekNumbers.SelectedIndex = !cal.ShowWeekNumbers ? 0 : cal.WeekNumberRule == SftDateWeekRuleConstants.weekRuleSftDateISO8601 ? 2 : 1;
            comboFirstDay.Items.AddRange(new object[] { "(Culture)", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" });
            comboFirstDay.SelectedIndex = (int)cal.FirstDayOfWeek;
            comboViews.Items.AddRange(new object[] { "All", "Month and year", "Month only" });

VB.NET View entire sample code

        comboHighContrast.SelectedIndex = CInt(sftCalendar.HighContrastMode)
        comboButtons.Items.AddRange(New Object() {"Dropdown", "Up/down", "Dropdown, up/down", "None"})
        comboButtons.SelectedIndex = CInt(fieldDate.Buttons)
        comboBorder.Items.AddRange(New Object() {"Single", "3D", "None"})
        comboBorder.SelectedIndex = Math.Max(0, Array.IndexOf(borderStyles, fieldDate.BorderStyle))
        comboAlignment.Items.AddRange(New Object() {"Near", "Far"})
        comboAlignment.SelectedIndex = CInt(fieldDate.DropDownAlignment)
        comboAcross.Items.AddRange(New Object() {"1", "2", "3"})
        comboAcross.SelectedIndex = cal.MonthsAcross - 1
        comboDown.Items.AddRange(New Object() {"1", "2"})
        comboDown.SelectedIndex = cal.MonthsDown - 1
        comboWeekNumbers.Items.AddRange(New Object() {"None", "Culture rule", "ISO 8601"})
        comboWeekNumbers.SelectedIndex = If(Not cal.ShowWeekNumbers, 0, If(cal.WeekNumberRule = SftDateWeekRuleConstants.weekRuleSftDateISO8601, 2, 1))
        comboFirstDay.Items.AddRange(New Object() {"(Culture)", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"})
        comboFirstDay.SelectedIndex = CInt(cal.FirstDayOfWeek)
        comboViews.Items.AddRange(New Object() {"All", "Month and year", "Month only"})

C++ View entire sample code

        for (int i = 0; i < FIELDS; ++i)
            m_Fields[i]->BorderStyle = (SftDateBorderConstants) g_borderStyles[sel];
        break;
    case IDC_ALIGNMENT:
        for (int i = 0; i < FIELDS; ++i)
            m_Fields[i]->DropDownAlignment = (SftDateAlignConstants) sel;
        break;
    case IDC_ACROSS:
        m_Calendar->Calendar->MonthsAcross = sel + 1;
        break;
    case IDC_DOWN:
        m_Calendar->Calendar->MonthsDown = sel + 1;
        break;
    case IDC_WEEKNUMBERS:
        ForEachControl([&](auto& ctl) {
            ctl->Calendar->ShowWeekNumbers = sel > 0 ? VARIANT_TRUE : VARIANT_FALSE;

See Also SftDateCalendar Object | Object Hierarchy | Calendar Layout


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