Treeview expand nodes at the specified layer

Source: Internet
Author: User
// ================================================ ==========================================/// 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)

 

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.