|
|
|
|
- Colapsar/Expandir un TreeView mediante programación
- Ejemplo
Colapsar/ampliar una control TreeView mediante programación
Colapsar/Expandir un TreeView mediante programación - Para colapsar una control TreeView a través de la programación utilice TreeCollapse.
- Para ampliar un TreeView mediante programación, utilice TreeListItem con un Procedure local específico.
Se utilizan los siguientes códigos para: - Inicializar una control TreeView.
- expandir parte de la control TreeView.
- colapsar la control TreeView.
- Inicie el control TreeView programando:
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")
- Expandir todos los elementos: El procedimiento "ExpandAll" se llama por cada "hijo" encontrado. Esta Procedure expande todos los nodos "niños" colapsados del nodo "Postre"....
// Lists the "children" of "Desserts" node in "TREE_TVRecipe" treeview // The "ExpandAll" procedure is called // for each "child" of "Desserts" node found Res = TreeListItem(TREE_TVRecipe, "Recipe" + TAB + "Dessert", "ExpandAll")
// Local procedure named "ExpandAll" // This procedure expands all the collapsed "child" nodes of the "Desserts" node PROCEDURE ExpandAll(TREE_TVRecipe, ChildPath, ChildFound, Level, Pointer) // Is the element found a leaf? IF TreeTypeItem(TREE_TVRecipe, ChildPath + ChildFound) = tvLeaf THEN RETURN // Back to TreeListItem ELSE // Is the element found collapsed? IF TreeStatus(TREE_TVRecipe, ChildPath + ChildFound) = tvCollapse THEN TreeExpand(TREE_TVRecipe, ChildPath + ChildFound) END END
- Colapsar el nodo "Dessert.
// Collapses the "Desserts" node in the "TREE_TVRecipe" control Res = TreeCollapse(TREE_TVRecipe, "Recipe" + TAB + "Dessert")
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|