count elements in root, sub root sub-sub root treeview 
Author Message
 count elements in root, sub root sub-sub root treeview

i have a treeview similar with 5 Big Root:

AREA-8501 Big root

Quote:
>AG-1
>AG-2
>AG-3
>AG-4
>>SETT-1
>>>last element-1 of tree
>>>last element-8 of tree
>>>last element-6 of tree
...
>>SETT-6
>>SETT-10
....
>AG-20
>AG-30
>AG-41
>>SETT-18
>>SETT-1
>>SETT-2

..
AREA-8502  Big root
AREA-8503  Big root
AREA-8504  Big root
AREA-8505  Big root

i want to count:
how many Big root area in treeview
how many AG are in each Big root
how many SETT are in each AG

--
Message posted via VBMonster.com
http://www.*-*-*.com/



Thu, 07 Jul 2011 06:25:49 GMT  
 count elements in root, sub root sub-sub root treeview


Quote:
>i have a treeview similar with 5 Big Root:

> AREA-8501 Big root
>>AG-1
>>AG-2
>>AG-3
>>AG-4
>>>SETT-1
>>>>last element-1 of tree
>>>>last element-8 of tree
>>>>last element-6 of tree
> ...
>>>SETT-6
>>>SETT-10
> ....
>>AG-20
>>AG-30
>>AG-41
>>>SETT-18
>>>SETT-1
>>>SETT-2
> ..
> AREA-8502  Big root
> AREA-8503  Big root
> AREA-8504  Big root
> AREA-8505  Big root

> i want to count:
> how many Big root area in treeview
> how many AG are in each Big root
> how many SETT are in each AG

You could use For Each and loop through the Nodes collection while checking
for Child/Children Properties. Another way I use in some situations to link
Nodes to UDF arrays in code is using the Node Tag property. I use a char
separator to specify multiple dimensions when I add each node. Example:

ndItem.Tag = "1|0|0"

Then use Split function to separate the numbers. My UDF structure would look
like this:

Type T_SETT
    sName    As String
End Type

Type T_AG
    sName    As String
    SETT() As T_SETT
End Type

Type T_Big
    sName    As String
    AG() As T_AG
End Type

Public Big() As T_Big

To increase a sub array without affecting other arrays, I would use this
code:

ReDim Preserve Big(3).AG(5) As T_AG

This increases AG in the third root to 5 elements, without affecting the
root array or other arrays in different roots.



Thu, 07 Jul 2011 07:09:27 GMT  
 count elements in root, sub root sub-sub root treeview

Quote:

>>i have a treeview similar with 5 Big Root:

>[quoted text clipped - 27 lines]
>> how many AG are in each Big root
>> how many SETT are in each AG

>You could use For Each and loop through the Nodes collection while checking
>for Child/Children Properties. Another way I use in some situations to link
>Nodes to UDF arrays in code is using the Node Tag property. I use a char
>separator to specify multiple dimensions when I add each node. Example:

>ndItem.Tag = "1|0|0"

>Then use Split function to separate the numbers. My UDF structure would look
>like this:

>Type T_SETT
>    sName    As String
>End Type

>Type T_AG
>    sName    As String
>    SETT() As T_SETT
>End Type

>Type T_Big
>    sName    As String
>    AG() As T_AG
>End Type

>Public Big() As T_Big

>To increase a sub array without affecting other arrays, I would use this
>code:

>ReDim Preserve Big(3).AG(5) As T_AG

>This increases AG in the third root to 5 elements, without affecting the
>root array or other arrays in different roots.

wow tks!
But sure not for me... i am a newbie
code?

--
Message posted via VBMonster.com
http://www.vbmonster.com/Uwe/Forums.aspx/vb/200901/1



Thu, 07 Jul 2011 07:26:20 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. find the specify Root key and Sub key from the registry

2. find the specify Root Key and Sub Key

3. menus and sub-menus and sub-sub-menus

4. root element is missing

5. Manage (root) in treeview

6. Using a db for root node of a treeview

7. TreeView - Trouble displaying first root node

8. Problem with TreeView .root Property

9. root node of a treeview

10. Going through all nodes of particular Root in Treeview

11. Using a db for root node of a treeview

12. TreeView Control with root node doesn't work for Cassio e-125 model

 

 
Powered by phpBB® Forum Software