Add Method
Description
Adds a new tree node to the collection.
Syntax
Public Function Add( _
Optional ByVal [Relative](#) As Variant, _
Optional ByVal [Relationship](#) As Variant, _
Optional ByVal [Key](#) As Variant, _
Optional ByVal [Text](#) As Variant, _
Optional ByVal [Image](#) As Variant _
) As [TreeViewNode](XtremeSuiteControls~TreeViewNode.md)
Parameters
-
Relative: Optional. The index number or key of a pre-existing Node object. The relationship between the new node and this pre-existing node is found in the next argument, Relationship.
-
Relationship: Optional. Specifies the relative placement of the Node object. A value from the TreeViewRelationship enumeration is used to determine the relationship of the new node to the code specified in the relative parameter. If no Node object is named in relative, the new node is placed in the last position of the top node hierarchy.
-
Key: Optional. A unique string that can be used to retrieve the Node with the Item method.
-
Text: Required. The string that appears in the Node.
-
Image: Optional. The index of an image in an associated ImageManager/ImageList control.
Remarks
The Nodes collection is a 1-based collection. As a Node object is added, it is assigned an index number, which is stored in the Node object's Index property. This value of the newest member is the value of the Node collection's Count property.
Because the Add method returns a reference to the newly created Node object, it is most convenient to set properties of the new Node using this reference.
See Also
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.