#1,035 – DatePicker Basics
March 24, 2014 1 Comment
The DatePicker is a control that operates like the Calendar control, allowing the user to select a date, but does so in a dropdown calendar that appears when the user clicks on a calendar icon in the control. Unlike the Calendar control, the DatePicker allows selecting only a single date.
<StackPanel> <Label Content="Calendar:"/> <Calendar /> <Label Content="DatePicker:" Margin="0,10,0,0"/> <DatePicker Margin="5,0"/> </StackPanel>
The DatePicker looks a bit like a TextBox, with an area to enter some text and a calendar icon to the right.
If you click on the calendar icon in the DatePicker, a calendar appears as a popup, allowing selection of a date.
Once you select a date, the date is then displayed in the text area.
You can also type a date manually into the text area of the DatePicker.