VB6 TreeView Nodes limit problem
Posted on 2004-04-09
I have a VB6 TreeView control in my VB6 application, and I need to load a lot of data into the tree, say 50,000 nodes. The treeview was able to load all 50,000 nodes all right - although very slow - and the nodes show up in the tree. The problem is, when I iterate through the nodes like this:
Dim Nodes As MSComctlLib.Nodes, curNode As MSComctlLib.Node
Dim i As Long
Set Nodes = MyTree.Nodes
For i = 1 To Nodes.count
Set curNode = Nodes.Item(i)
If curNode.children > 0 Then
' Do some thing with the node
The Nodes.count will be a negative -27536 when actually there are 50,000 node in the treeview. It seems like there is a limit to Nodes.count that you cannot exceed, and the iteration in the code above won't work.
Do anyone has a solution to my problem?
Thanks for your help.