DatePicker.DisplayDateEnd 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定要顯示的最後一個日期。
public:
property Nullable<DateTime> DisplayDateEnd { Nullable<DateTime> get(); void set(Nullable<DateTime> value); };
public DateTime? DisplayDateEnd { get; set; }
member this.DisplayDateEnd : Nullable<DateTime> with get, set
Public Property DisplayDateEnd As Nullable(Of DateTime)
屬性值
要顯示的最後一個日期。
範例
下列範例會建立 , DatePicker 以限制下拉式行事曆只在 2009 年顯示日期。
DatePicker datePickerFor2009 = new DatePicker();
datePickerFor2009.SelectedDate = new DateTime(2009, 3, 23);
datePickerFor2009.DisplayDateStart = new DateTime(2009, 1, 1);
datePickerFor2009.DisplayDateEnd = new DateTime(2009, 12, 31);
datePickerFor2009.SelectedDateFormat = DatePickerFormat.Long;
datePickerFor2009.FirstDayOfWeek = DayOfWeek.Monday;
// root is a Panel that is defined elsewhere.
root.Children.Add(datePickerFor2009);
Dim datePickerFor2009 As New DatePicker()
datePickerFor2009.SelectedDate = New DateTime(2009, 3, 23)
datePickerFor2009.DisplayDateStart = New DateTime(2009, 1, 1)
datePickerFor2009.DisplayDateEnd = New DateTime(2009, 12, 31)
datePickerFor2009.SelectedDateFormat = DatePickerFormat.[Long]
datePickerFor2009.FirstDayOfWeek = DayOfWeek.Monday
' root is a Panel that is defined elsewhere.
root.Children.Add(datePickerFor2009)
<!-- A DatePicker that has March 23, 2009 selected and
displays the Long date format. -->
<DatePicker SelectedDateFormat="Long" SelectedDate="3/23/09"
DisplayDateStart="1/01/09" DisplayDateEnd="12/31/09"
FirstDayOfWeek="Monday"/>
備註
這個屬性會影響 Calendar 的 DatePicker 。 如需詳細資訊,請參閱 Calendar.DisplayDateEnd 屬性 (Property)。
相依性屬性資訊
識別碼欄位 | DisplayDateEndProperty |
中繼資料屬性設定為 true |
BindsTwoWayByDefault |
XAML Attribute Usage
<DatePicker DisplayDateEnd="dateTimeString"/>
XAML 值
dateTimeString
日期,其格式為 DateTime XAML 語法 主題所列的其中一種格式。