Skip to content

Latest commit

 

History

History
46 lines (29 loc) · 1.48 KB

datepicker_monthvisible.md

File metadata and controls

46 lines (29 loc) · 1.48 KB
-api-id -api-type
P:Windows.UI.Xaml.Controls.DatePicker.MonthVisible
winrt property

Windows.UI.Xaml.Controls.DatePicker.MonthVisible

-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