Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 21: Tree and List Controls



  1. Resize the dialog box to 430 x 230

  2. On the dialog box, delete the TODO line and the OK button

  3. Change the caption of the Cancel button to Close

  4. From the Controls toolbox, click the Tree Control button and click on the left
    area of the dialog box

  5. Change its ID to IDC_CAR_TREE

  6. Set its location to 7, 7 and its dimensions to 114 x 216


21.1.2..Tree List Properties.............................................................................


As mentioned already, a tree list is meant to
display items in a list driven by a root and
followed by one or more leaves. The items are
mainly made of text. Optionally, to display a
check box on the left side of the text, set the
Check Boxes property to True or add the
TVS_CHECKBOXES style (if you are using
MSVC 6 and you had added the Tree Control
button to the form or dialog box, open the
resource file as text and manually add this style
because it may not be available on the
Properties window).

To guide the user with the tree items, the control uses tool tips. If you will need access to
the information stored in tool tips, set the Info Tip property to True or add the
TVS_INFOTIP style. If you do not want to display tool tips, set the Tool Tips property
to False or create it with the TVS_NOTOOLTIPS style.
Free download pdf