Drawing Owner-drawn Items
When you indicate that a control is owner-drawn, either by setting a property or supplying a custom draw event handler, the control is no longer drawn on the screen. Instead, the operating system generates events for each visible item in the control. Your application handles the events to draw the items.
To draw the items in an owner-draw control, do the following for each visible item in the control. Use a single event handler for all items.
- Size the item, if needed. Items of the same size (for example, with a list box style of lsOwnerDrawFixed), do not require sizing.
- Draw the item.