|
|
|
|
|
- Contraer/Expandir un TreeView mediante programación
- Ejemplo
Colapsar/Expandir un control TreeView programáticamente
Contraer/Expandir un TreeView mediante programación - Para colapsar un control TreeView mediante programación, use TreeCollapse.
- Para expandir un TreeView mediante programación, utiliza TreeListItem con un procedimiento local específico.
Los siguientes códigos se utilizan para: - inicializar un control TreeView.
- 0.
- 0.
- Inicializa el control TreeView programáticamente:
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert", "CAKE-.BMP", "CAKE-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Ice cream")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Ice cream" + ...
TAB + "Vanilla", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Ice cream" + ...
TAB + "Strawberry", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Ice cream" + ...
TAB + "Chocolate", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Cup")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Cup" + ...
TAB + "Banana Split", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Cup" + ...
TAB + "Cherry Garcia", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Cup" + ...
TAB + "Colonel", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Apple pie")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Apple pie" + ...
TAB + "with whipped cream", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Apple pie" + ...
TAB + "with apple brandy", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Crème brûlée", "NEXT5-.BMP")
TreeAdd(TREE_TVRecipe, "Recipe" + TAB + "Dessert" + TAB + "Meringue with cream", "NEXT5-.BMP")
- Expande todos los elementos. Se llama al procedimiento "ExpandAll" para cada elemento "child" encontrado. Este procedimiento expande todos los nodos "hijo" colapsados del nodo "Postre".
Res = TreeListItem(TREE_TVRecipe, "Recipe" + TAB + "Dessert", "ExpandAll")
PROCEDURE ExpandAll(TREE_TVRecipe, ChildPath, ChildFound, Level, Pointer)
IF TreeTypeItem(TREE_TVRecipe, ChildPath + ChildFound) = tvLeaf THEN
RETURN
ELSE
IF TreeStatus(TREE_TVRecipe, ChildPath + ChildFound) = tvCollapse THEN
TreeExpand(TREE_TVRecipe, ChildPath + ChildFound)
END
END
- Colapsar el nodo "Dessert".
Res = TreeCollapse(TREE_TVRecipe, "Recipe" + TAB + "Dessert")
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|