Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

VS 2012 Loading specific files from folder into treeview

$
0
0
Hi there,

I have to load more then 8K images into a treeview, which won't work due to out-of-memory-exception, but that's not for now.
I have a list of all names of the files within the imagefolder. Specific files need to be within a different parent-node.

How do I accomplish this? (if within an array: how do I apply it within my code?)

My code (3rd party control):

Code:

  Dim lnode As New Node("Exceptions")  ' create parentnode
  .Nodes.Add(lnode)  ' add parentnode to treeview
  For Each x In My.Computer.FileSystem.GetFiles(msopath)
      Dim n As New Node(Path.GetFileNameWithoutExtension(x.ToString))
      'n.Image = Image.FromFile(x)  ' <-- comment out for now... out-of-memory exception
      lnode.Nodes.Add(n)  ' add the filnames (and the image) to the parentnode
  Next


Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>