ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   treeView -- multiple selection (https://www.excelbanter.com/excel-programming/332832-treeview-multiple-selection.html)

Julio

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

Damon Longworth

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" wrote in message
...
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




Julio

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" wrote in message
...
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





michelxld[_9_]

treeView -- multiple selection
 

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


--
michelxld
------------------------------------------------------------------------
michelxld's Profile: http://www.excelforum.com/member.php...o&userid=17367
View this thread: http://www.excelforum.com/showthread...hreadid=382208


Stephen Bullen[_4_]

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



Julio

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




Stephen Bullen[_4_]

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




All times are GMT +1. The time now is 04:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com