// ================================================ ====================================
// Function: f_expand ()
//--------------------------------------------------------------------
// Description: Expand the tree control atv to the ai_e layer of the ai_s node.
//--------------------------------------------------------------------
// Parameters:
// Value treeview atv source tree control
// Value long al_h current node handle
// Value integer ai_now number of layers of the current node
// Value integer ai_s start layer to expand
// Value integer ai_e indicates the number of ending layers to be expanded.
//--------------------------------------------------------------------
// Return: (none)
//--------------------------------------------------------------------
// Author: Date: 2011.04.08
// ================================================ ====================================
// If the input node is invalid, return
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, which is between the layers to be expanded, then expand the current node
Atv. expanditem (al_h)
Else // hide other
Atv. CollapseItem (al_h)
End if
Ai_now ++ // start to traverse the subnode. The number of layers of the node increases by 1.
Ll_h = atv. 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 layer 1st to Layer 3, call:
-
f_expand(tv_1, tv_1.finditem(rootTreeItem!, 0), 1, 1, 3)