|
-
June 9th, 1999, 04:03 AM
#2
Re: trees trees help me im goin nutz!
Here is how to insert some text, include the image, and change the state of the item from plain text to bold. You MUST have created a CImageList and set it into the tree control with SetImageList() before using this:
---// Add the root item, with its own icon (params: text for label, HTREEITEM
// (= branch) to add to).
hRoot = pTree->InsertItem("C:\\", TVI_ROOT);
// Set the image to be used for this branch (params: branch, index into image
// list (image strip) for basic image, same again for selected image (I use the
// same) ). IMAGE_ROOT is my own definition, and is an index into the parts of
// the bitmap used for the image list.
pTree->SetItemImage(hRoot, IMAGE_ROOT, IMAGE_ROOT);
// Make the root bold letters (params: branch, combination of state bits, mask
// specifying which bits in the combination value are valid (therefore, usually
// both the same value to set just one state at a time) ).
pTree->SetItemState(hRoot, TVIS_BOLD, TVIS_BOLD);
---
You will get more info in the demo project I sent you...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|