I am trying to use the MonthCalendar control to pass a value to a Text box using the DateDiff function. The idea is that if a user selects a date from the MonthCalendar control the selected date value is then passed to a variable (Firstdate) which in turn is used in the Datediff function to update the Text box.
eg. FirstDate = CDate(FirstDate)
lblDate.Text = DateDiff(DateInterval.Day, Now, FirstDate)
Although I can use the MonthCalendar1.SetDate method to write the value to a variable (and a msgbox), I cannot figure out what method or code to use when a user clicks on a date in the MonthCalendar control and pass that value to the variable.
MSDN talks about Raising events. Any help would be appreciated.
eg. FirstDate = CDate(FirstDate)
lblDate.Text = DateDiff(DateInterval.Day, Now, FirstDate)
Although I can use the MonthCalendar1.SetDate method to write the value to a variable (and a msgbox), I cannot figure out what method or code to use when a user clicks on a date in the MonthCalendar control and pass that value to the variable.
MSDN talks about Raising events. Any help would be appreciated.