COUNT element on a click plus sign

User avatar
sal21
PlatinumLounger
Posts: 4363
Joined: 26 Apr 2010, 17:36

COUNT element on a click plus sign

Post by sal21 »

Ho to count the related children based i click on a plus sign?

image 1
click on plus sign NORD-OVEST, count 4 regions
image2
click on plus sign PIEMONTE, count 8 provinces
image3
click on plus sign ASTI, count 38 comuni

I hope you understand me....
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78547
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: COUNT element on a click plus sign

Post by HansV »

Code: Select all

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
    Dim ChildCount As Long
    ChildCount = Node.Children
    MsgBox "The selected node has " & ChildCount & " children"
End Sub
Best wishes,
Hans