HeaderPane
Main
Hide
Share Link
Print

DisplayStart Property, SftCalendar Object

Defines the first month shown.

Syntax

Get

C#DateTime Date = object.DisplayStart;
VB.NETDate = object.DisplayStart As Date
C++DATE Date = object->DisplayStart;
DATE Date = object->GetDisplayStart();
CHRESULT object->get_DisplayStart(DATE* Date);

Put

C#DateTime object.DisplayStart = Date;
VB.NETobject.DisplayStart = Date As Date
C++DATE object->DisplayStart = Date;
void object->PutDisplayStart(DATE Date);
CHRESULT object->put_DisplayStart(DATE Date);

object

A SftCalendar object.

Date

Defines the first month shown.

Comments

The DisplayStart property defines the first period shown: in the month view the first month, in the year view the first year, in the decade and century views the first decade or century. Reading it returns the first day of that period; setting it shows the period containing the date. A new control shows the period containing the current date first. p The control raises the DisplayChanged event when the periods shown change. FirstDisplayedDate and LastDisplayedDate return the first and last day shown, including trailing days.

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

    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

    Private Sub sftCalendar_ClearClicked(sender As Object, e As EventArgs) Handles sftCalendar.ClearClicked

C++ View entire sample code

    static LPCTSTR views[] = { _T("Month"), _T("Year"), _T("Decade"), _T("Century") };
    int view = m_Calendar->View;
    LogEvent(id, _T("ViewChanged"), CString(), view >= 0 && view < 4 ? views[view] : _T("?"));
    return TRUE;
}

BOOL CMainDlg::OnDisplayChanged(UINT id)
{
    LogEvent(id, _T("DisplayChanged"), CString(), FormatDate(_variant_t(m_Calendar->DisplayStart, VT_DATE)));
    return TRUE;
}

BOOL CMainDlg::OnTodayClicked(UINT id)
{
    LogEvent(id, _T("TodayClicked"));
    return TRUE;

See Also SftCalendar Object | Object Hierarchy | Calendar Layout


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