treeView -- multiple selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Either I'm missing something, or the example in puremis doesn't allow you to
select more than one item at a time.
JK
 
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
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top