HeaderPane
Main
Hide
Share Link
Print

View Property, SftCalendar Object

Defines the view shown (month, year, decade or century).

Syntax

Get

C#SftDateViewConstants View = object.View;
VB.NETView = object.View As SftDateViewConstants
C++enum SftDateViewConstants View = object->View;
enum SftDateViewConstants View = object->GetView();
CHRESULT object->get_View(enum SftDateViewConstants* View);

Put

C#SftDateViewConstants object.View = View;
VB.NETobject.View = View As SftDateViewConstants
C++enum SftDateViewConstants object->View = View;
void object->PutView(enum SftDateViewConstants View);
CHRESULT object->put_View(enum SftDateViewConstants View);

object

A SftCalendar object.

View

Defines the view shown (month, year, decade or century).

NameValueDescription
viewSftDateMonth0Days of a month
viewSftDateYear1Months of a year
viewSftDateDecade2Years of a decade
viewSftDateCentury3Decades of a century

Comments

The View property defines the view of the month calendar control: the days of a month, the months of a year, the years of a decade or the decades of a century. The user switches views by clicking the title and by choosing a period. The control raises the ViewChanged event when the view changes. p A view that is not allowed (Calendar.AllowedViews) causes an error. Calendar.InitialView defines the view the control starts with.

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

    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

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

See Also SftCalendar Object | Object Hierarchy | Calendar Layout


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