ProblemYou want to display a full-year calendar on a reasonably sized form. SolutionUse the MonthCalendar control, dock it to fill its parent form, and size the form large enough that all 12 months appear. DiscussionThe MonthCalendar control normally displays only one month at a time, with buttons and controls to toggle through neighboring months and years as desired. However, if it's docked to the center of the form ("Fill") or other parent control, it attempts to fill the area completely. Instead of displaying larger text, the control displays multiple months either side by side or stacked vertically, depending on which way you stretch the form. Stretch the form a little, and suddenly the one-month calendar changes to display two months. Keep going, and it will display three, four, or more months in a rectangular array. At a form size of about 551 pixels wide by 615 pixels high, a full year of a dozen months displays nicely in a three-across and four-high pattern. Figure 7-21 shows the form at this size. Figure 7-21. A nice one-year calendar displayed with no code at all |