HeaderPane
Main
Hide
Share Link
Print

DisplayChanged Event, SftCalendar Object

The months shown changed.

Syntax

C#void object_DisplayChanged(object sender, System.EventArgs e);
VB.NETPrivate Sub object_DisplayChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles object.DisplayChanged
C++void OnDisplayChangedobject();
CHRESULT OnDisplayChangedobject();

object

A SftCalendar object.

Comments

The DisplayChanged event occurs when the periods shown change, for example when the user scrolls to the next month. FirstDisplayedDate and LastDisplayedDate return the first and last day shown, so the application can load the data it needs for them.

Examples

C# View entire sample code

        }

        private void sftCalendar_ViewChanged(object sender, EventArgs e) {
            string[] views = { "Month", "Year", "Decade", "Century" };
            LogEvent(sender, "ViewChanged", "", views[(int)sftCalendar.View]);
        }

        private void sftCalendar_DisplayChanged(object sender, EventArgs e) {
            LogEvent(sender, "DisplayChanged", "", FormatDate(sftCalendar.DisplayStart));
        }

        private void sftCalendar_TodayClicked(object sender, EventArgs e) {
            LogEvent(sender, "TodayClicked");
        }

        private void sftCalendar_ClearClicked(object sender, EventArgs e) {

VB.NET View entire sample code

        LogEvent(sender, "DateActivated", "Date=" & FormatDate(e.date))
    End Sub

    Private Sub sftCalendar_ViewChanged(sender As Object, e As EventArgs) Handles sftCalendar.ViewChanged
        Dim views As String() = {"Month", "Year", "Decade", "Century"}
        LogEvent(sender, "ViewChanged", "", views(CInt(sftCalendar.View)))
    End Sub

    Private Sub sftCalendar_DisplayChanged(sender As Object, e As EventArgs) Handles sftCalendar.DisplayChanged
        LogEvent(sender, "DisplayChanged", "", FormatDate(sftCalendar.DisplayStart))
    End Sub

    Private Sub sftCalendar_TodayClicked(sender As Object, e As EventArgs) Handles sftCalendar.TodayClicked
        LogEvent(sender, "TodayClicked")
    End Sub

C++ View entire sample code

    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 2 /* RangeChanged */, OnRangeChanged, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 3 /* ValueValidating */, OnValueValidating, VTS_I4 VTS_PVARIANT VTS_PVARIANT VTS_PBOOL)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 4 /* TextParsing */, OnTextParsing, VTS_I4 VTS_BSTR VTS_VARIANT VTS_PBOOL VTS_PVARIANT)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 5 /* DropDownOpening */, OnDropDownOpening, VTS_I4 VTS_PBOOL)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 6 /* DropDownOpened */, OnDropDownOpened, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 7 /* DropDownClosed */, OnDropDownClosed, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 9 /* DateActivated */, OnDateActivated, VTS_I4 VTS_DATE)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 10 /* ViewChanged */, OnViewChanged, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 11 /* DisplayChanged */, OnDisplayChanged, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 12 /* TodayClicked */, OnTodayClicked, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 13 /* ClearClicked */, OnClearClicked, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 14 /* DarkModeChange */, OnDarkModeChange, VTS_I4 VTS_BOOL)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 15 /* HighContrastChange */, OnHighContrastChange, VTS_I4 VTS_BOOL)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 16 /* DPIChanged */, OnDPIChanged, VTS_I4 VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 20 /* KeyDown */, OnKeyDown, VTS_I4 VTS_PI2 VTS_I2)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 21 /* KeyPress */, OnKeyPress, VTS_I4 VTS_PI2)

See Also SftCalendar Object | Object Hierarchy | Calendar Layout


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