DatePicker.YearVisible Property

Definition

Gets or sets a value that indicates whether the year selector is shown.

Equivalent WinUI property: Microsoft.UI.Xaml.Controls.DatePicker.YearVisible.

public:
 property bool YearVisible { bool get(); void set(bool value); };
bool YearVisible();

void YearVisible(bool value);
public bool YearVisible { get; set; }
var boolean = datePicker.yearVisible;
datePicker.yearVisible = boolean;
Public Property YearVisible As Boolean
<DatePicker YearVisible="bool"/>

Property Value

Boolean

bool

true if the year selector is shown; otherwise, false. The default is true.

Remarks

By default, the DatePicker shows ComboBox elements to select the month, day, and year. Set YearVisible to false to hide the ComboBox that displays or changes the year component of a date.

Here's the picker with the year field hidden.

A date picker with the year field hidden.

Applies to

See also