HeaderPane
Main
Hide
Share Link
Print

ViewChanged Event, SftCalendar Object

The view changed.

Syntax

C#void object_ViewChanged(object sender, System.EventArgs e);
VB.NETPrivate Sub object_ViewChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles object.ViewChanged
C++void OnViewChangedobject();
CHRESULT OnViewChangedobject();

object

A SftCalendar object.

Comments

The ViewChanged event occurs when the view of the calendar (View) changes, by the user or the application.

Examples

C# View entire sample code

        }

        private void sftCalendar_DateActivated(object sender, _ISftCalendarEvents_DateActivatedEvent e) {
            LogEvent(sender, "DateActivated", "Date=" + FormatDate(e.date));
        }

        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) {

VB.NET View entire sample code

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

    Private Sub sftCalendar_DateActivated(sender As Object, e As _ISftCalendarEvents_DateActivatedEvent) Handles sftCalendar.DateActivated
        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

C++ View entire sample code

    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 1 /* ValueChanged */, OnValueChanged, VTS_I4)
    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)

See Also SftCalendar Object | Object Hierarchy | Calendar Layout


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