Reference > TDBCalendar Control > TDBCalendar Control Events > Scroll Event (TDBCalendar) |
Occurs when scrolling the calendar view. The Scroll event occurs whenever the user invokes a scroll action and changes the year or the month value displayed on the upper left position.
control_Scroll (StartDate As Date, EndDate As Date)
startdate is the first date that appears in the upper left (first) month within the calendar view. This date returns a normal date and not the trailing days nor dates that are specified with the MinDate and MaxDate properties.
enddate is the last date that appears in the lower right (last) month within the calendar view. This date returns a normal date and not trailing days nor dates that are specified with the MinDate and MaxDate properties.
The startdate and the enddate parameters provide information for the new months that are displayed in the calendar view. To retrieve the trailing start and end date or the minimum/maximum date if it is displayed in the current view, you can call the GetDatesInView method. For example:
' Handle the Scroll event.
Private Sub Calendar_Scroll(StartDate As Date, EndDate As Date)
Dim StartDt, EndDt
GetDatesInView StartDt, EndDt, dbiTrailingDay
Debug.Print StartDt & vbTab & EndDt
End Sub