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 Calendar1_DateChanging(ByVal HeaderArrow As EXCALENDARLibCtl.HeaderArrowEnum, Cancel As Variant) Cancel = True With Calendar1 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.
Syntax for DateChanging event, /NET version, on:
private void DateChanging(object sender,exontrol.EXCALENDARLib.HeaderArrowEnum HeaderArrow,ref object Cancel) { } Private Sub DateChanging(ByVal sender As System.Object,ByVal HeaderArrow As exontrol.EXCALENDARLib.HeaderArrowEnum,ByRef Cancel As Object) Handles DateChanging End Sub |
private void DateChanging(object sender, AxEXCALENDARLib._ICalendarComboEvents_DateChangingEvent e) { } void OnDateChanging(long HeaderArrow,VARIANT FAR* Cancel) { } void __fastcall DateChanging(TObject *Sender,Excalendarlib_tlb::HeaderArrowEnum HeaderArrow,Variant * Cancel) { } procedure DateChanging(ASender: TObject; HeaderArrow : HeaderArrowEnum;var Cancel : OleVariant); begin end; procedure DateChanging(sender: System.Object; e: AxEXCALENDARLib._ICalendarComboEvents_DateChangingEvent); begin end; begin event DateChanging(long HeaderArrow,any Cancel) end event DateChanging Private Sub DateChanging(ByVal sender As System.Object, ByVal e As AxEXCALENDARLib._ICalendarComboEvents_DateChangingEvent) Handles DateChanging End Sub Private Sub DateChanging(ByVal HeaderArrow As EXCALENDARLibCtl.HeaderArrowEnum,Cancel As Variant) End Sub Private Sub DateChanging(ByVal HeaderArrow As Long,Cancel As Variant) End Sub LPARAMETERS HeaderArrow,Cancel PROCEDURE OnDateChanging(oCalendar,HeaderArrow,Cancel) RETURN |
<SCRIPT EVENT="DateChanging(HeaderArrow,Cancel)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function DateChanging(HeaderArrow,Cancel) End Function </SCRIPT> Procedure OnComDateChanging OLEHeaderArrowEnum llHeaderArrow Variant llCancel Forward Send OnComDateChanging llHeaderArrow llCancel End_Procedure METHOD OCX_DateChanging(HeaderArrow,Cancel) CLASS MainDialog RETURN NIL void onEvent_DateChanging(int _HeaderArrow,COMVariant /*variant*/ _Cancel) { } function DateChanging as v (HeaderArrow as OLE::Exontrol.Calendar.1::HeaderArrowEnum,Cancel as A) end function function nativeObject_DateChanging(HeaderArrow,Cancel) return |