#Include once "window9.bi"

Function CalEv Alias "CalEv"(ByVal gadget As Integer) As Integer Export
  Static As Byte sta,sta1
  Select Case GetClassName_(GadgetID(gadget))
    Case "SysDateTimePick32"
      sta+=1
      If sta=1 Then
        Return 1
      ElseIf sta=6 Then
        sta=0
      EndIf
    Case "SysMonthCal32"
      sta1+=1
      If sta1=1 Then
        Return 1
      ElseIf sta1=3 Then
        sta1=0
      EndIf
  End Select
  Return 0
End Function
