#363 – Calendar Control Basics

The Calendar control displays an image of a calendar and allows a user to select a date.  By default, the calendar shows a single month that includes the current date.

    <StackPanel HorizontalAlignment="Center" Margin="15">
        <Calendar Name="cal"/>
        <Label Content="{Binding ElementName=cal, Path=SelectedDate, StringFormat=d}"/>

When the user selects a date on the calendar, the SelectedDate property indicates the day that was selected.

You can use the left and right arrow icons at the top of the control to navigate to the previous/next month.

The Calendar control can also display a single year, or a single decade.  To switch to the Year mode, click on the name of the month at the top of the control.

You can now navigate to the previous/next year using the arrows, or click on a specific month.

You can switch to Decade mode by clicking on the year at the top of the control.


About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

3 Responses to #363 – Calendar Control Basics

  1. Brack Bhuvan says:

    Very nice article. I really enjoyed it reading. And it also cleared lot of my doubts about Calendar Control in WPF. I’ve found some other good article related to this post over internet which also explained very well you may check out this links….




  2. Pingback: #1,034 – Limiting the Range of Selectable Dates in a Calendar | 2,000 Things You Should Know About WPF

  3. Pingback: #1,035 – DatePicker Basics | 2,000 Things You Should Know About WPF

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: