A date was chosen with a click or the Enter key.
| C# | void object_DateActivated(object sender, AxSftDateLib20._ISftCalendarEvents_DateActivatedEvent e); |
| VB.NET | Private Sub object_DateActivated(ByVal sender As Object, ByVal e As AxSftDateLib20._ISftCalendarEvents_DateActivatedEvent) Handles object.DateActivated |
| C++ | void OnDateActivatedobject(DATE Date); |
| C | HRESULT OnDateActivatedobject(DATE Date); |
object
Date
The date chosen.
The DateActivated event occurs when the user chooses a date: a click on a day, Enter on the focused day, or the end of a range selected with the mouse (the last date of the range). p The selection itself is reported using the ValueChanged and RangeChanged events; DateActivated reports the user's choice, for example to open the day's appointments.
LogEvent(sender, "ValueChanged", "", FormatDate(sftCalendar.Value));
}
private void sftCalendar_RangeChanged(object sender, EventArgs e) {
LogEvent(sender, "RangeChanged");
}
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 Sub sftCalendar_ValueChanged(sender As Object, e As EventArgs) Handles sftCalendar.ValueChanged
LogEvent(sender, "ValueChanged", "", FormatDate(sftCalendar.Value))
End Sub
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
BEGIN_EVENTSINK_MAP(CMainDlg, CDialog)
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)See Also SftCalendar Object | Object Hierarchy | Calendar Components