|
|
|
|
- Collapsing/Expanding a TreeView through programming
- Example
Collapsing/Expanding a TreeView control through programming (prefix syntax)
Collapsing/Expanding a TreeView through programming The following codes are used to: - initialize a TreeView control.
- expand part of the TreeView control.
- collapse the TreeView control.
- Initialize the TreeView control by programming:
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert", "CAKE-.BMP", "CAKE-.BMP")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Ice cream")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Ice cream" + ...
TAB + "Vanilla", "NEXT5-.BMP")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Ice cream" + ...
TAB + "Strawberry", "NEXT5-.BMP")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Ice cream" + ...
TAB + "Chocolate", "NEXT5-.BMP")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Cup")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Cup" + ...
TAB + "Banana Split", "NEXT5-.BMP")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Cup" + ...
TAB + "Cherry Garcia", "NEXT5-.BMP")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Cup" + ...
TAB + "Colonel", "NEXT5-.BMP")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Apple pie")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Apple pie" + ...
TAB + "with whipped cream", "NEXT5-.BMP")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Apple pie" + ...
TAB + "with apple brandy", "NEXT5-.BMP")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Crème brûlée", "NEXT5-.BMP")
TREE_TVRecipe.Add("Recipe" + TAB + "Dessert" + TAB + "Meringue with cream", "NEXT5-.BMP")
- Expand all the elements: The "ExpandAll" procedure is called for each "child" element found. This procedure expands all the collapsed "child" nodes of the "Dessert" node.
Res = TREE_TVRecipe.ListItem("Recipe" + TAB+ "Dessert", "ExpandAll")
PROCÉDURE ExpandAll(TREE_TVRecipe, ChildPath, ChildFound, Level, Pointer)
IF TREE_TVRecipe.TypeItem(ChildPath + ChildFound) = tvLeaf THEN
RETURN
ELSE
IF TREE_TVRecipe.Status(ChildPath + ChildFound) = tvCollapse THEN
TREE_TVRecipe.Expand(ChildPath + ChildFound)
END
END
- Collapse the "Dessert" node.
Res = TREE_TVRecipe.Collapse("Recipe" + TAB + "Dessert")
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|