virtual CRect OnGetCheckPosition( CRect rectItem, CRect rectCheckBox );
Return Value
The position and size of an item's check box.
Parameters
rectItem
The position and size of the list item.
rectCheckBox
The default position and size of an item's check box.
Remarks
The framework calls this function to get the position and size of the check box in an item.
The default implementation only returns the default position and size of the check box (rectCheckBox). By default, a check box is aligned in the upper-left corner of an item and is the standard check box size. There may be cases where you want the check boxes on the right, or want a larger or smaller check box. In these cases, override OnGetCheckPosition to change the check box position and size within the item.
For example, the following function overrides the default and puts the check box on the right of the item, makes it the same height as the item (minus a pixel offset at the top and bottom), and makes it the standard check box width:
CRect CMyCheckListBox::OnGetCheckPosition(CRect rectItem, CRect rectCheckBox)
{
CRect rectMyCheckBox;
rectMyCheckBox.top = rectItem.top -1;
rectMyCheckBox.bottom = rectItem.bottom -1;
rectMyCheckBox.right = rectItem.right -1;
rectMyCheckBox.left = rectItem.right -1 - rectCheckBox.Width();
return rectMyCheckBox;
}
CCheckListBox Overview | Class Members | Hierarchy Chart
See Also CCheckListBox::SetCheck, CCheckListBox::SetCheckStyle, CCheckListBox::GetCheck, CCheckListBox::GetCheckStyle