Defines the view shown (month, year, decade or century).
Get
| C# | SftDateViewConstants View = object.View; |
| VB.NET | View = object.View As SftDateViewConstants |
| C++ | enum SftDateViewConstants View = object->View; enum SftDateViewConstants View = object->GetView(); |
| C | HRESULT object->get_View(enum SftDateViewConstants* View); |
Put
| C# | SftDateViewConstants object.View = View; |
| VB.NET | object.View = View As SftDateViewConstants |
| C++ | enum SftDateViewConstants object->View = View; void object->PutView(enum SftDateViewConstants View); |
| C | HRESULT object->put_View(enum SftDateViewConstants View); |
object
View
Defines the view shown (month, year, decade or century).
| Name | Value | Description |
|---|---|---|
| viewSftDateMonth | 0 | Days of a month |
| viewSftDateYear | 1 | Months of a year |
| viewSftDateDecade | 2 | Years of a decade |
| viewSftDateCentury | 3 | Decades of a century |
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.
}
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) {
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.TodayClickedSee Also SftCalendar Object | Object Hierarchy | Calendar Layout