CCheckListBox

The CCheckListBox class provides the functionality of a Windows checklist box. A “checklist box” displays a list of items, such as filenames. Each item in the list has a check box next to it that the user can check or clear.

CCheckListBox is only for owner-drawn controls because the list contains more than text strings. At its simplest, a checklist box contains text strings and check boxes, but you do not need to have text at all. For example, you could have a list of small bitmaps with a check box next to each item.

To create your own checklist box, you must derive your own class from CCheckListBox. To derive your own class, write a constructor for the derived class, then call Create.

If your checklist box is a default checklist box (a list of strings with the default-sized checkboxes to the left of each), you can use the default CCheckListBox::DrawItem to draw the checklist box. Otherwise, you must override the CListBox::CompareItem function and the CCheckListBox::DrawItem and CCheckListBox::MeasureItem functions.

You can create a checklist box either from a dialog template or directly in your code.

#include <afxwin.h>

Class MembersBase ClassHierarchy Chart

Samples   MFC Sample TSTCON

See Also   CListBox