Tutorials > VSPrinter Tutorial - Calendar > Step 3: Browsing months |
The next step is to add code to the browsing buttons. To achieve this, all we need to do is add or subtract a month from the global variable TheDate and regenerate the calendar. Double-click each of the browsing buttons, and then add the following code to the Click event handler:
Example Title |
Copy Code
|
---|---|
Private Sub cmdPrev_Click() TheDate = TheDate - 30 ShowCalendar End Sub Private Sub cmdNext_Click() TheDate = TheDate - 30 ShowCalendar End Sub |