Type | Description | |||
HeaderArrow as HeaderArrowEnum | A HeaderArrowEnum expression that indicates the arrow being clicked. | |||
Cancel as Variant | (By Reference) A Boolean expression that specifies whether the default operation is canceled or not. |
The following VB sample changes the month to prev or next when user clicks the LEFT or RIGHT buttons, instead prev / next Year ( which is by default ).
Private Sub CalendarCombo1_DateChanging(ByVal HeaderArrow As EXCalendarComboLibCtl.HeaderArrowEnum, Cancel As Variant) Cancel = True With CalendarCombo1 If (HeaderArrow = exPrevYear) Then .Date = DateAdd("m", -1, .Date) Else If (HeaderArrow = exNextYear) Then .Date = DateAdd("m", 1, .Date) End If End If End With End Sub
Previously the ShowMonthSelector property is set on False, so only the LEFT and RIGHT buttons are displayed. By default, the LEFT and RIGHT arrows changes the year, while the UP and DOWN arrows changes the month. The sample hides the UP and DOWN buttons, and let only the LEFT and RIGHT buttons and the code changes the current date to prev or next month.