The Day Planner manages a number of appointments and displays them in a day calendar fashion. The control can be tweaked to display 1 day only to several days at a time. The appointments are displayed in such a way that it's easy to see when they're scheduled for the current day.
By hovering over an appointment with the mouse, a ToolTip is displayed with
the complete appointment description. And when they are clicked or double-clicked, the
control responds by sending notifications to the owner window.
Drag'n'drop is supported within the view, so appointments can be dragged around
and their scheduling time gets updated.
A number of style flags determine how the control is drawn. Several of the UI components
(such as the day-text header) can be turned off, as well as the ability to customize how appointments
are positioned and managed.
The control supports custom drawing by sending out WM_DRAWITEM
notifications
whenever it needs to paint an appointment. The owner window may catch these messages and do the
painting instead.
The Sample
This sample demonstrates the beginning of a PIM application. It's not complete and currently doesn't allow you to manually edit the information in each appointment.The sample does however demonstrate how to persist appointments (it loads and saves from an XML file), and acts as an example on how to operate the two controls.
Interface
Name | Description | |
---|---|---|
![]() | GetCurSel | Retrieves the currently selected date. |
![]() | SetCurSel | Sets the date to display. |
![]() | GetSelectedIndex | Retrieves the index of the currently selected appointment. |
![]() | SetDayPlannerStyle | Changes the extended control styles. |
![]() | DeleteAllItems | Removes all appointments from the view. |
![]() | AddItem | Adds a new appointment. |
![]() | GetItemCount | Returns the present number of appointments. |
![]() | GetItem | Returns an appointment. |
![]() | SetImageList | Assigns an ImageList. |
![]() | SetTextFont | Sets the font for the appointment text. |
![]() | SetDayRange | Configures how many days are displayed. |
![]() | SetInterval | Minute interval to display for every hour. |
![]() | SetWorkingHours | Sets current working hours for display. |
![]() | HitTest | Tests which day or appointment is located at the coordinates. |
![]() | SetTopIndex | Scroll a specific hour into view. |
![]() | SetItemMinSize | Sets the minimum appointment height. |
![]() | GetCalendarRange | Retrieves the range of days currently displayed in the view. |
Source Code Dependencies
Microsoft Visual C++ 6.0Microsoft WTL 3.1 Library
See Also
The Calendar controlDownload Files
![]() | Source Code (89 Kb) |