User Drawn Functionality
The dbicDayView "User Drawn" functionality allows the developer to take control of the painting of objects in the control. User Drawn functionality is surfaced in two areas of the control ...
User Drawn Column Headers: The drawing of the header area of each column in the dbicDayView control.
User Drawn Appointments: The drawing of each appointment in the control.
User Drawn Column Header
Every time the dbicDayView control goes to paint a column header, the UserDrawnHeader Event is fired. The event passes an "e" argument with all of the information and properties necessary for the developer to cancel the default drawing of the text in the header area and/or the background of the header area and replace them with custom drawn objects. The "e" (event) argument in the UserDrawnHeader Event passes the following properties ...
- e.Graphics (of type System.Drawing.Graphics) - A graphics handle to the custom area provided to the developer within the header area being drawn. Through the e.Graphics object the developer has access to the GDI+ methods for drawing objects to a display device.
- e.PaintBackGround - a flag that when set false allows the developer to override the default painting of the background and custom paint the area. If this is set to true the control handles the painting of the background internally.
- e.PaintText - a flag that when set false allows the developer to override the default painting of the text and custom paint the text. If this is set to true the control handles the painting of the text internally.
- e.Rect - A rectangle representing the custom area being painted in the control. The rectangle is defined by an X,Y coordinate (top left of rectangle) and a width and height of the area being painted. All values are in pixels.
- e.ContactID - Identifies the contact associated with the column when grouping by Contact.
- e.Date - Identifies the date associated with the column when grouping by Date.
- e.LocationID - Identifies the location associated with the column when grouping by Location.
- e.TaskID - Identifies the task associated with the column when grouping by Task.
User Drawn Appointment
Every time the dbicDayView control paints an appointment the UserDrawnAppointment Event is fired. The event passes an "e" argument with all of the information and properties necessary for the developer to cancel the default drawing of the text in the appointment area and/or the background of the appointment area and replace them with custom drawn objects. User Drawn Appointments behave the same as standard appointments. The "e" (event) argument in the UserDrawnAppointment Event passes the following properties ...
- e.Graphics (of type System.Drawing.Graphics) - A graphics handle to the custom area provided to the developer within the header area being drawn. Through the e.Graphics object the developer has access to the GDI+ methods for drawing objects to a display device.
- e.PaintAppointment - a flag that when set false allows the developer to override the default painting of the appointment and custom paint the area. If this is set to true the control handles the painting of the appointment internally.
- e.PaintText - a flag that when set false allows the developer to override the default painting of the text and custom paint the text. If this is set to true the control handles the painting of the text internally.
- e.Rect - A rectangle representing the custom area being painted in the control. The rectangle is defined by an X,Y coordinate (top left of rectangle) and a width and height of the area being painted. All values are in pixels.
- e.AllDay - Indicates if the appointment being drawn is in the all day area.
- e.Appointment - A handle to the appointment object being drawn.
- e.Selected - Indicates if the appointment being drawn is selected.
For an example of the implementation of User Drawn Headers and User Drawn Appointments please review the dbicDayViewUserDrawn sample application that accompanies the product.