This control is an encapsulateion of the Windows month calendar control. A month calendar control implements a calendar-like user interface, that provides the user with a very intuitive and recognizable method of entering or selecting a date. Users can also select which days bold. The most efficient way to add the bolded dates is via an array all at once. (The below descriptions can be applied equally to annually and monthly bolded dates as well) The following is an example of this:
MonthCalendar mc = new MonthCalendar(); // add specific dates to bold DateTime[] time = new DateTime[3]; time[0] = DateTime.Now; time[1] = time[0].addDays(2); time[2] = time[1].addDays(2); mc.setBoldedDates(time);
Removal of all bolded dates is accomplished with:
mc.removeAllBoldedDates();
Although less efficient, the user may need to add or remove bolded dates one at a time. To improve the performance of this, neither addBoldedDate nor removeBoldedDate repaints the monthcalendar. The user must call updateBoldedDates to force the repaint of the bolded dates, otherwise the monthCalendar will not paint properly. The following is an example of this:
DateTime time1 = new DateTime("3/5/98"); DateTime time2 = new DateTime("4/19/98"); mc.addBoldedDate(time1); mc.addBoldedDate(time2); mc.removeBoldedDate(time1); mc.updateBoldedDates();
The same applies to addition and removal of annual and monthly bolded dates.
Object
MarshalByRefObject
MarshalByRefComponent
Control
RichControl
MonthCalendar
[Visual Basic] Public Class MonthCalendar Inherits RichControl [C#] public class MonthCalendar : RichControl [C++] public __gc class MonthCalendar : public RichControl [JScript] public class MonthCalendar extends RichControl
[To be supplied.]
Namespace: System.WinForms
Assembly: System.WinForms.dll