Setting the date picker presentation.

Theme

The simplest way to modify the presentation is to use the Theme property. This property affects only the colors used to render the control and is limited to a small set of options. See the property documentation for details.

Number of Months

You can control how many months appear at one time in a variety of ways. If you just want to display as many readable months as possible, simply leave the Autosize property on. If, however, you need to show a specific number of months, then set the Autosize property to zero and use the GridSize property to set the number of months. The GridSize property allows you to specify the number of month rows and month columns. So, if you want to show 4 months, you can show 1 column and 4 rows, 2 columns and 2 rows, or 4 columns and 1 row. The choice is yours.

Style

You can change arbitrary dates' style using the DayStyle property or SetDayStyles method. These allow you to indicate special states to the user by changing a date's text color, background color, or font. The property and method accept both single dates and date ranges for convenience. See the DayStyle property for details.

If you want to change the font used to render everything, use the Font property. Think of it as the default font, which is used when there is no day style applied to a particular date.

By default, today's date always appears with a colored rectangle around it. If you do not want today's date to be highlighted, then set the HighlightToday property to zero.

Names

You can customize the names used for the months and the days of week. Use the MonthNames property to customize the month names and the DayOfWeekNames to customize the days of week. You can customize all the names, some of the names, or none of the names. If you set any name to "", then the default name is used.

Layout

You can alter the layout of dates using a few properties. The FirstDayOfWeek property allows you to choose which day of week appears at in the left most column of the month. For internationalization purposes, you can also enable the RightToLeft property to show the weeks right to left. You can hide the non-month days using the ShowNonMonthDays property or show the week numbers using the ShowWeekNumbers property.

See Also

ThemeAutosizeGridSizeDayStyleHighlightTodayMonthNamesDayOfWeekNamesFirstDayOfWeekRightToLeftShowNonMonthDaysShowWeekNumbers

  • No labels