#363 – Calendar Control Basics
August 12, 2011 3 Comments
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}"/> </StackPanel>
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.
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….
http://mindstick.com/Articles/47af6cd1-5ddd-4a9c-a862-27a90dd5da31/?Calendar%20Control%20in%20WPF
http://www.c-sharpcorner.com/uploadfile/mahesh/wpf-calendar-control/
http://www.c-sharpcorner.com/uploadfile/mahesh/wpf-calendar-control/
Pingback: #1,034 – Limiting the Range of Selectable Dates in a Calendar | 2,000 Things You Should Know About WPF
Pingback: #1,035 – DatePicker Basics | 2,000 Things You Should Know About WPF