System.Windows.Forms.TreeView Selecting Nodes selected

  • Thread starter Thread starter Marcelo Muzilli
  • Start date Start date
M

Marcelo Muzilli

Howdy all,

I´d like to know how can I get in a ArrayList (for example) all the
selected nodes from my TreeView object.

I´m trying to use the following code and is not working. Why?

Do you have a good example?

My sample code:
..
..
..
ArrayList MyArrayListVar = new ArrayList();

foreach (TreeNode n in trvMain.SelectedNodes)
{
MyArrayListVar.Add(n.Text);
}
..
..
..
Thank you in advance,

Marcelo Muzilli
 
Marcelo said:
Howdy all,

I´d like to know how can I get in a ArrayList (for example) all the
selected nodes from my TreeView object.

Maybe I misunderstand you, but surely a TreeView control only allows a
single node to be selected?
 
Back
Top