The concept of owner drawn controls is not MFC specific. For some Windows controls it is already implemented (buttons, combo boxes, list boxes, and menus). When setting the corresponding owner draw style flag for these controls, the normal drawing is suppressed and a
message is send to the window. MFC supports owner drawing for these controls (
) by implementing an empty virtual
member function which is called upon the
message. With owner drawn controls, this function must be implemented in the drived class. See CButton::DrawItem
] for an example.
Implementing owner draw for other controls can be done by handling the
messages. With MFC, derive a class and add handlers for these messages performing your own drawing without calling the corresponding base class functions.