DatePickerFormat 列舉
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指定 DatePicker 的日期格式。
public enum class DatePickerFormat
public enum DatePickerFormat
type DatePickerFormat =
Public Enum DatePickerFormat
- 繼承
欄位
Long | 0 | 指定應該使用非縮寫的星期和月份名稱來顯示日期。 這個值顯示的字串會等於 ToLongDateString() 方法所傳回的字串。 |
Short | 1 | 指定應該使用縮寫的星期和月份名稱來顯示日期。 這個值顯示的字串會等於 ToShortDateString() 方法所傳回的字串。 |
範例
下列範例會建立 , DatePicker 其會使用一周和月份名稱的未細分天數來顯示日期。
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"/>