WPF 4 Date selector (datepicker)

Source: Internet
Author: User
In the previous article "WPF 4 calendar control (calendar)", we had a basic understanding of how to use the calendar control, this article will continue to introduce another new control "datepicker" in WPF 4 ). Compared with calendar, datepicker has a textbox to extract the date selected from the calendar.

For more information about datepicker attribute settings, see the calendar control. OnlyDisplaymode,SelectionmodeAttribute cannot be used in datepicker. First look at the following XAMLCode:

 <  Datepicker  X  :  Name  = "Datepickerctl"  Width  = "200"  Height  = "25" Selecteddateformat  = "Long"  Firstdayofweek  = "Monday"  Displaydatestart  = "2010/4/1"  Displaydateend  = "2010/4/20"  Istodayhighlighted  = "False"> <  Datepicker. blackoutdates  > <  Calendardaterange  Start  = "2010/4/3"  End = "2010/4/5"/> <  Calendardaterange  Start  = "2010/4/10"  End  = "2010/4/12"/> </  Datepicker. blackoutdates  > </  Datepicker  > 

OnlySelecteddateformatThe attribute does not appear in the calendar control. This attribute is mainly used to set the display mode of the selected date:Long,Short. The two display methods are the same as the system calendar date format.

Long and Short display results:

Datepicker also supports direct Date input. For example, enter the date "2010/4/15" in the textbox, and click calendar to display the filled Date:

References

1. WPF 4 calendar control (calendar)

Http://www.cnblogs.com/gnielee/archive/2010/04/11/wpf4-calendar-control.html

2. datepicker class

Http://msdn.microsoft.com/en-us/library/system.windows.controls.datepicker (V = vs.100). aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.