Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Treeview Control and Node Items

Status
Not open for further replies.

Foada

Programmer
Feb 4, 2002
1,110
US
Has anyone ever noticed this before? If you add a treeview control and a command button to a new project and drop this code in the command buttons click event

Private Sub Command1_Click()
Dim nds As Nodes
Dim str As String
'
Set nds = TreeView1.Nodes
str = "Set Breakpoint Here and look at the nds Items in the Locals Window, there are 256?"
End Sub

set a break point at the str assignment and then run the app, click the command button and take a look at the "nds" variable in the Locals Window you will see that there are 256 Items set to Variant/Empty, and the Count property shows 0. I am assuming that the Nodes Collection must be some sort of Linked list (CMap?) that is initialized with enough memory for 256 Items, but I was wondering if anyone can confirm this assumption? Any insight? [spin]

If you choose to battle wits with the witless be prepared to lose.

[cheers]
 
Hi Paul,

I though that was the case as well, but why would it not show the same for a regular Collection object? I also noticed that if you add over 256 items to the Treeview's Nodes collection, that the Locals window only shows the 256 items even though there are more. It was this behavior that made me think the nodes collection must be a type of C linked list like a CList or CMap. [flip]

If you choose to battle wits with the witless be prepared to lose.

[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top