Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 20: List-Based Controls Visual C++ and MFC Fundamentals



  1. Save All


19.2.2..Check Box Properties.........................................................................


To provide a check box to an application, on the Controls toolbox, click the Check Box

button and click the desired area on the dialog box or form. If you require more than
one check box, you can keep adding them as you judge necessary.

Like the radio button, a check box is a button with just a different style. Therefore, it
shares the same characteristics as the radio button. This means that we can simply avoid
repeating the descriptions we reviewed for the radio control.

Like the radio button, the accompanying label of the check box can appear on the left or
the right side of the square box. Also, you can control the horizontal and the vertical
alignments of its label using the Horizontal Alignment or the Vertical Alignment
properties.

We saw that a radio button can appear as a regular command button with 3-D borders.
This feature is also available for check boxes. When a check box with the Push-Like
property is up and then clicked, it stays down until it is clicked again, regardless of the
appearance of the other controls. Remember that a check box behaves independently of
the other controls even if it appears in a group.

A check box can be checked or unchecked. The check box as a control adds a third state
for its appearance. Instead of definitely appearing as checked or unchecked, a check box
can appear “half-checked”. This is considered as a third state. To apply this behavior to a
check box, set its Tri-State property to True or add the BS_3STATE style to it:
Free download pdf