Showing Dates with the Calendar Control

The Calendar control 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:

<StackPanel Orientation="Horizontal">    <Calendar Name="Calendar1" Margin="5"          BorderBrush="Blue" BorderThickness="3"          SelectedDatesChanged="Calendar1_SelectedDatesChanged">    </Calendar>    <TextBox Name="TextBox1" Margin="5" Height="30" Width="200"/></StackPanel>

The SelectedDatesChanged event is raised when the user clicks a different date. The following is instead the event handler that gets the instance ...

Get Visual Basic 2015 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.