Defines the first month shown.
Get
| C# | DateTime Date = object.DisplayStart; |
| VB.NET | Date = object.DisplayStart As Date |
| C++ | DATE Date = object->DisplayStart; DATE Date = object->GetDisplayStart(); |
| C | HRESULT object->get_DisplayStart(DATE* Date); |
Put
| C# | DateTime object.DisplayStart = Date; |
| VB.NET | object.DisplayStart = Date As Date |
| C++ | DATE object->DisplayStart = Date; void object->PutDisplayStart(DATE Date); |
| C | HRESULT object->put_DisplayStart(DATE Date); |
object
Date
Defines the first month shown.
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.
}
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) {
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
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