dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: How to make multiple selections from a tree control?

Hybrid View

  1. #1
    Join Date
    May 2002
    Posts
    1,798

    How to make multiple selections from a tree control?

    I would like to be able to sweep the mouse cursor down over a 'simple' CTreeCtrl list in order to capture the text therein. Something analogous to a CListCtrl, where separate items could be selected using the [Ctrl] - mousel click and contiguous items could be selected using the [Shfit]-DownArrow, etc.

    I know this can be done because I've seen it in another app. But how to do it. Must be some means of modifying the control style or subclassing the control.

    Any suggestions (other than 'why don't you just use a CListCtrl') most welcome.

    Here's a starting point demo. I found this. It works but the code is a bit difficult to follow at first glance.

    A multi-select tree control class
    By The Chard July 25, 1999
    http://www.codeguru.com/cpp/controls...ticle.php/c629
    Last edited by Mike Pliam; November 7th, 2011 at 08:27 PM.
    mpliam

  2. #2
    Join Date
    May 2006
    Location
    Dresden, Germany
    Posts
    458

    Re: How to make multiple selections from a tree control?

    There is no "built-in" functionality for a multi select tree control in MS-Windows.
    Subclassing a tree control is a possibility, but it is still much work to do.

    Maybe this is helpful: http://www.codeproject.com/KB/tree/M..._Treeview.aspx.

    Regards
    PA

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,602

    Re: How to make multiple selections from a tree control?

    Tree-View Control Window Styles
    TVS_CHECKBOXES is what you need.
    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)