Calendar

The Calendar control is new in .NET 4 and shows a calendar where you can select a particular day in the specified month and year. The following XAML code defines a calendar with a custom border and a TextBox that contains the selected date to be assigned programmatically:

image

The SelectedDatesChanged event is raised when the user clicks a different date. The following is instead the event handler that gets the instance of the calendar and sends the selected date to the text box:

image

Figure 32.2 shows the result of our work.

Figure 32.2 Implementing ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.