|
|
|
|
How to associate an image with a treeview element?
When fillilng a TreeView control, an image is associated with each element. It is a small symbol representing an opened or closed folder. Indeed, each level and each element of the treeview can be: - collapsed (image of closed folder by default).
- expanded (image of opened folder by default).
These images can be modified through programming. Remark: The image proposed by default for the elements in a TreeView control can also be changed with the CollapsedImage and ExpandedImage properties. To modify the images representing the collapsed or expanded element, the desired images must be specified in TreeAdd and TreeInsert. The syntax for TreeAdd is as follows:
TreeAdd(<TreeView name>, <Element>, <Name of collapsed image>, <Name of expanded image>)
Code sample:
TreeAdd(TREE_Product, "Man", "M1.jpg", "M2.jpg") TreeAdd(TREE_Product, "Woman", "W1.jpg", "W2.jpg") TreeAdd(TREE_Product, "Man" + TAB + "Trousers", "trousers.JPG", "trousers.JPG") TreeAdd(TREE_Product, "Man" + TAB + "Jacket", "jacket.JPG", "jacket.JPG") TreeAdd(TREE_Product, "Man" + TAB + "Shoes", "shoesM.JPG", "shoesM.JPG") TreeAdd(TREE_Product, "Woman" + TAB + "Dress", "dress.JPG", "dress.JPG") TreeAdd(TREE_Product, "Woman" + TAB + "Pullover", "pullover.JPG", "pullover.JPG") TreeAdd(TREE_Product, "Woman" + TAB + "Shoes", "shoesW.JPG", "shoesW.JPG")
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|