// ================================================ ==========================================/// Function: f_expand () // extract // Description: Expand the node from the tree control atv to the ai_e layer, and collapse the nodes on the other layers. // extract // parameter: // value treeview atv source tree control // value long al_h handle of the current node // value integer ai_now number of layers of the current node // value integer ai_s start number of layers to be expanded/v The end layers to be expanded by alue integer ai_e // ------------------------------------------------------------------ // return: (none) // else // Author: Date: 2011.04.08 // ========================================== ============================================/// the input node is invalid, if al_h <1 then return long ll_h if ai_now> = ai_s and ai_now <= ai_e then // number of layers of the current node. if the number of layers to be expanded is between, the current node atv is expanded.. Expanditem (al_h) else // hide other atv. collapseItem (al_h) end if ai_now ++ // start to traverse the subnode, and Add 1 ll_h = atv to the number of node layers. finditem (ChildTreeItem !, Al_h) do while ll_h> 0 f_expand (atv, ll_h, ai_now, ai_s, ai_e) ll_h = atv. finditem (NextTreeItem !, Ll_h) loop, for example, to expand 1st to the third layer, call: f_expand (TV _1, TV _1.finditem (rootTreeItem !, 0), 1, 1, 3)