Expand the node at the ai_s to the ai_e layer of the tree control atv.

Source: Internet
Author: User

// ================================================ ====================================
// 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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.