JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the MonthCalendar Class

As discussed in the In Depth section of this chapter, you can use month calendar controls to let the user select days of the month; you can see an example in Figure 8.4. Here's the class hierarchy for this control:

Object
   MarshalByRefObject
      Component
         Control
            MonthCalendar

You can find the more notable public properties of the MonthCalendar class in Table 8.14, the more notable methods in Table 8.15, and the more notable events in Table 8.16. Note that as with other Windows forms controls, I am not listing the notable properties, methods, and events MonthCalendar inherits from the Control class, such as the Click event—you can see all that in Tables 5.1, 5.2, and 5.3, Chapter 5.

Table 8.14: Noteworthy public properties of MonthCalendar objects.

Property

Means

AnnuallyBoldedDates

Holds an array of DateTime objects specifying which days should be bold.

BoldedDates

Gets/sets an array of DateTime objects specifying which dates should be bold.

CalendarDimensions

Gets/sets the number of columns and rows.

FirstDayOfWeek

Gets/sets the first day of the week.

MaxDate

Gets/sets the maximum possible date.

MaxSelectionCount

Holds the maximum number of days that can be selected.

MinDate

Gets/sets the minimum possible date.

MonthlyBoldedDates

Holds the array of DateTime objects which specify which monthly days to display bold.

ScrollChange

Holds the scroll rate.

SelectionEnd

Gets/sets the end date of a selected range.

SelectionRange

Gets the selected range of dates for a month calendar control.

SelectionStart

Gets/sets the start date of a selected range of dates.

ShowToday

Gets/sets if today's date is shown at the bottom of the control.

ShowTodayCircle

Gets/sets if today's date should appear inside a circle.

ShowWeekNumbers

Gets/sets if the month calendar control should display week numbers.

SingleMonthSize

Returns the minimum size in which to display a month.

TitleBackColor

Gets/sets the back color of the calendar's title area.

TitleForeColor

Gets/sets the fore color of the calendar's title area.

TodayDate

Gets/sets today's date.

TodayDateSet

Indicates if the DateTime property has been set.

Table 8.15: Noteworthy public methods of MonthCalendar objects.

Method

Means

AddAnnuallyBoldedDate

Adds a day, displayed in bold annually.

AddBoldedDate

Adds a day that is displayed as bold.

AddMonthlyBoldedDate

Adds a day to be displayed in bold monthly in the calendar.

GetDisplayRange

Gets date information that specifies the range displayed dates.

RemoveAllAnnuallyBoldedDates

Removes all annually bolded dates.

RemoveAllBoldedDates

Removes all non-recurring bolded dates.

RemoveAllMonthlyBoldedDates

Removes all monthly bolded dates.

RemoveAnnuallyBoldedDate

Removes indicated date from the calendar's internal list of annually bolded dates.

RemoveBoldedDate

Removes a date from the calendar's internal list of non-recurring dates to display in bold.

RemoveMonthlyBoldedDate

Removes a date from the calendar's internal list of monthly dates to display in bold.

SetCalendarDimensions

Sets the number of columns and rows.

SetDate

Sets the selected date.

SetSelectionRange

Sets the selected dates to the given range of dates.

UpdateBoldedDates

Redisplays the bolded dates.

Table 8.16: Noteworthy public events of MonthCalendar objects.

Event

Means

DateChanged

Occurs when the date in the calendar control changes.

DateSelected

Occurs when a date is selected in the calendar.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor