Pictures for items
There are several ways to use pictures in a TreeView. You
associate a picture in one of the picture lists with an item by setting
one of the item’s picture properties, described in the following
table.
|
Property |
Purpose |
|---|---|
|
PictureIndex |
The primary picture associated with the item is |
|
StatePictureIndex |
A state picture is displayed to the left of the Because a state picture takes up room, items A use for state |
|
OverlayPictureIndex |
An overlay picture is displayed on top of an item’s You set up the overlay picture list An overlay picture is |
|
SelectedPictureIndex |
A picture from the regular picture list that is If you do not want a different picture when |
How to set pictures
You can change the pictures for all items at a particular level
with the SetLevelPictures function, or you can set the picture
properties for an individual item.
If you do not want
pictures
Your TreeView does not have to use pictures for items. If an
item’s picture indexes are 0, no pictures are displayed. However, the
TreeView always leaves room for the regular picture. You can set the
PictureWidth property to 0 to eliminate that space:
|
1 2 |
tv_2.DeletePictures() tv_2.PictureWidth = 0 |