How to: Add and Configure a Calendar Control

Use the Calendar control to display dates and give your users date-picking functionality.

To add a Calendar control to an ASP.NET mobile Web Forms page

  1. Drag a Calendar control from the Mobile Web Forms tab of the Toolbox onto a Form or Panel control, or inside a control's template on a ASP.NET mobile Web page. You can also drag it onto a mobile user control page.

  2. If needed, change the following property values:

    1. Select false for the ShowDayHeader property if you do not want to show the days of the week.

    2. Select a different day of the week for the FirstDayOfWeek property if you do not want the default, which is Sunday.

    3. Use the SelectionMode property to specify whether the user can select a single day, a week, or an entire month.

    4. Use the SelectedDate property to define the default selected date when the SelectionMode property is set to single-day selection.

    5. Select a date for the VisibleDate property to display a particular month on the calendar.

    6. Change the appearance of the calendar by changing properties such as ForeColor and Font.

      NoteNote

      Not all display devices implement font and color properties.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2015 Microsoft