Windows.UI.Xaml.Controls.DatePicker.MonthVisible

June 22, 2022 ยท View on GitHub

-description

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

-xaml-syntax

<DatePicker MonthVisible="bool"/>

-property-value

true if the month 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 MonthVisible to false to hide the ComboBox that displays or changes the month component of a date.

Here's the picker with the month field hidden.

![images/date-time/date-picker-month-hidden.png](A date picker with the month field hidden.)

It's typically not useful to show the day field without the month for context. A more common usage is to hide both the day and month, and show only the year, like this.

<DatePicker x:Name="yearDatePicker" Header="In what year was Microsoft founded?" 
            MonthVisible="False" DayVisible="False"/>

A date picker with the day and month fields hidden.

-examples

-see-also

DayVisible, YearVisible, MonthFormat, Date picker