Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Calendar.DisplayDateChanged Event

Occurs when the DisplayDate property is changed.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls (in System.Windows.Controls.dll)

'Declaration
Public Event DisplayDateChanged As EventHandler(Of CalendarDateChangedEventArgs)
<sdk:Calendar DisplayDateChanged="eventhandler"/>

This event occurs after DisplayDate is assigned its new value.

The following event handler updates a TextBox with information from the DisplayDateChanged event. This example is part of a larger example available in the Calendar overview.


'Updates a TextBlock with information from the DisplayDateChanged event. 
'This will happen every time the visible month changes, whether triggered 
'by user input or by code. 
Private Sub cal_DisplayDateChanged(ByVal sender As Object, ByVal e As CalendarDateChangedEventArgs) Handles cal.DisplayDateChanged
    'This should never occur unless DisplayDate is explicitly set to nothing. 
    If e.RemovedDate Is Nothing Then
        text1.Text = "Changed DisplayDate from nothing to " + e.AddedDate + "!"
    Else
        text1.Text = "Changed DisplayDate from " + e.RemovedDate + " to " + e.AddedDate + "!"
    End If
End Sub


Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

Show:
© 2017 Microsoft