Collapsing all branches

WEBINAR:
On-Demand

Application Security Testing: An Integral Part of DevOps


Have you ever had the experience that you have expanded the outline at various points causing a lot of items to be visible and then finding it difficult to locate a particular item. Well, it happens with me all the time. So heres the code that will collapse all the branches in the outline as if the treeview control has just been initialized with the data.
 
// CollapseAll  - Collapses the complete outline.
void CTreeCtrlX::CollapseAll()
{
        HTREEITEM hti = GetRootItem();
        do{
                CollapseBranch( hti );
        }while( (hti = GetNextSiblingItem( hti )) != NULL );
}
This uses the function we developed for collapsing a branch. It goes through all the root items and collapses them.



Comments

  • How to create a treeview and display it in list view ?

    Posted by pean on 05/23/2007 01:35am

    can you guid specific me how to create a treeview and display it in list view ?

    Reply
  • What about TVE_COLLAPSERESET?

    Posted by Legacy on 02/24/2004 12:00am

    Originally posted by: Ralf A.

    Why don't you use 
    
    

    Expand(hti,TVE_COLLAPSE | TVE_COLLAPSERESET);

    instead of that recursive function?

    Reply
  • Good tip~

    Posted by Legacy on 12/03/2002 12:00am

    Originally posted by: grinbee

    thanx man~
    for the good tip...

    Reply
  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Mobility is reaching an inflection point in enterprise. Smart enterprises are moving away from tactical point solutions for mobile device management, looking instead for a secure, comprehensive, unified, and future-proof mobile-app platform. Enterprise applications are now at the heart of mobile productivity, data is shared outside the enterprise walls, and the data itself may reside on multiple devices and clouds. Read this guide to learn how a unified endpoint management (UEM) solution is critical to …

  • IT planners have far more options as to where to run their workloads than ever before. On-premises data centers, co-location facilities and managed services providers are now joined by hybrid multi-clouds – a combination of Software-, Infrastructure- and Platform-as-a-Service (SaaS, IaaS, and PaaS) execution venues. All have unique operational, performance and economic characteristics that need to be considered when deploying workloads. Submit the form to watch this webinar replay featuring 451 …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date