Mutli Select

How can i have a tree view support multi select and then have a loop that runs through each selected item...
hessAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

amebaCommented:
' add treeview, set property Checkboxes=True
Option Explicit

Private Sub Form_Click()
    Dim x As Node, msg As String
    For Each x In Me.TreeView1.Nodes
        If x.Checked Then msg = msg & x.Text & vbCrLf
    Next
    MsgBox msg, , "Selected nodes"
End Sub

Private Sub Form_Load()
    Dim i As Integer
    For i = 1 To 15
        Me.TreeView1.Nodes.Add , , , "node " & i
    Next
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hessAuthor Commented:
i can see how taht would work ajnd i'll concider it, but i really would like pure multiselect.
0
MTroutwineCommented:
I do not believe the TreeView control supports the MultiSelect property.  I might suggest looking at ameba's code and possible creating your own 'custom' TreeView control that would support MultiSelect.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

hessAuthor Commented:
sounds difficlut...
0
MTroutwineCommented:
If you are interested in custom controls here is a good site: http://www.vbaccelerator.com/.  Do a search on TreeView. You will get a cool TreeView control with all of the code to boot!  I have modified this control and added some functionality that I needed, you could do the same thing.  If you do remember to rename the control!!!
0
hessAuthor Commented:
ok... thankyou... i actually checked there... been there before.. i theirs doesn't appear to suport multi select. anyways. thankyou. i'm going to go with the check boxes for now.
0
hessAuthor Commented:
i guess i'll leave this question up to see if i find a real way to multi select.
0
amebaCommented:
If you don't need collapsing/expanding of nodes, i.e. if all nodes are always open, you can have UI you want - it's called indented listview.
0
hessAuthor Commented:
sorry... they need to colapse
0
amebaCommented:
sorry, this is not supported by control.
0
hessAuthor Commented:
I ended up just playing with the back color property of the nodes but i started with check boxes and they worked for a time... now i just faked multi select... thankyou
0
amebaCommented:
¤ Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.