+ Reply to Thread
Results 1 to 7 of 7

treeView -- multiple selection

  1. #1
    julio
    Guest

    treeView -- multiple selection

    How do you set up a treeView control for multiple selection (i.e., select
    multiple files with <Shift> or <Ctll>)? This

    sub UserForm_Initialize()
    ......
    tvFiles.SingleSel = False
    .......

    doesn't work (clicking on a new item clears the previous selection).

    Thanks

  2. #2
    Damon Longworth
    Guest

    Re: treeView -- multiple selection

    This link will give you a description of the SingleSel property:

    http://msdn.microsoft.com/library/de...elproperty.asp

    Here is an example of using the TreeView control:

    http://puremis.net/excel/code/080.shtml

    --
    Damon Longworth

    Don't miss out on the 2005 Excel User Conference
    Sept 16th and 17th
    Stockyards Hotel - Ft. Worth, Texas
    www.ExcelUserConference.com


    "julio" <julio@discussions.microsoft.com> wrote in message
    news:2BD37EA7-A3B1-4670-AA04-CF42D3D1981B@microsoft.com...
    > How do you set up a treeView control for multiple selection (i.e., select
    > multiple files with <Shift> or <Ctll>)? This
    >
    > sub UserForm_Initialize()
    > ......
    > tvFiles.SingleSel = False
    > .......
    >
    > doesn't work (clicking on a new item clears the previous selection).
    >
    > Thanks




  3. #3
    julio
    Guest

    Re: treeView -- multiple selection

    Either I'm missing something, or the example in puremis doesn't allow you to
    select more than one item at a time.
    JK

    "Damon Longworth" wrote:

    > This link will give you a description of the SingleSel property:
    >
    > http://msdn.microsoft.com/library/de...elproperty.asp
    >
    > Here is an example of using the TreeView control:
    >
    > http://puremis.net/excel/code/080.shtml
    >
    > --
    > Damon Longworth
    >
    > Don't miss out on the 2005 Excel User Conference
    > Sept 16th and 17th
    > Stockyards Hotel - Ft. Worth, Texas
    > www.ExcelUserConference.com
    >
    >
    > "julio" <julio@discussions.microsoft.com> wrote in message
    > news:2BD37EA7-A3B1-4670-AA04-CF42D3D1981B@microsoft.com...
    > > How do you set up a treeView control for multiple selection (i.e., select
    > > multiple files with <Shift> or <Ctll>)? This
    > >
    > > sub UserForm_Initialize()
    > > ......
    > > tvFiles.SingleSel = False
    > > .......
    > >
    > > doesn't work (clicking on a new item clears the previous selection).
    > >
    > > Thanks

    >
    >
    >


  4. #4
    Forum Contributor
    Join Date
    12-11-2004
    MS-Off Ver
    2007
    Posts
    137
    Hello Julio , Hello Damon

    you could add checkboxes in your TreeView

    TreeView1.CheckBoxes = True


    and if you want to have informations about checked lines

    Private Sub CommandButton3_Click()
    Dim NodX As Node

    For Each NodX In TreeView1.Nodes
    If NodX.Checked = True Then MsgBox NodX.Text
    Next

    End Sub



    regards
    michel

  5. #5
    Stephen Bullen
    Guest

    Re: treeView -- multiple selection

    Hi Julio,

    > How do you set up a treeView control for multiple selection (i.e., select
    > multiple files with <Shift> or <Ctll>)? This


    I'm not sure about using ctrl to multi-select, but you could set the
    CheckBoxes option on, so each node gets a check box that can be ticked.

    Regards

    Stephen Bullen
    Microsoft MVP - Excel

    Professional Excel Development
    The most advanced Excel VBA book available
    www.oaltd.co.uk/ProExcelDev



  6. #6
    julio
    Guest

    Re: treeView -- multiple selection

    Hi Stephen,

    to put it more clearly, I need the functionality of the usual Windows Open
    File screen, where you can <Shift-Click> to select a number of files to open.
    This can't be mimicked with check boxes if you have more than a handful of
    filenames.

    Thanks


    "Stephen Bullen" wrote:

    > Hi Julio,
    >
    > > How do you set up a treeView control for multiple selection (i.e., select
    > > multiple files with <Shift> or <Ctll>)? This

    >
    > I'm not sure about using ctrl to multi-select, but you could set the
    > CheckBoxes option on, so each node gets a check box that can be ticked.
    >
    > Regards
    >
    > Stephen Bullen
    > Microsoft MVP - Excel
    >
    > Professional Excel Development
    > The most advanced Excel VBA book available
    > www.oaltd.co.uk/ProExcelDev
    >
    >
    >


  7. #7
    Stephen Bullen
    Guest

    Re: treeView -- multiple selection

    Hi Julio,

    > to put it more clearly, I need the functionality of the usual Windows Open
    > File screen, where you can <Shift-Click> to select a number of files to open.
    > This can't be mimicked with check boxes if you have more than a handful of
    > filenames.


    Well, I've never seen a Windows TreeView with that possibility. They're usually
    used to select single nodes, with a list to show (and multi-select among) the
    contents.

    Regards

    Stephen Bullen
    Microsoft MVP - Excel

    Professional Excel Development
    The most advanced Excel VBA book available
    www.oaltd.co.uk/ProExcelDev



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1