I click on? Treeview

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

I click on? Treeview

Post by sal21 »

I click on a node.
How to understand if i have clicked

on a
ZONA
or on a
REGIONE
or on a
PROVINCIA
or on a
COMUNE
No idea....
...

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

Re: I click on? Treeview

Post by HansV »

Air code:

Code: Select all

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
    Dim strPath As String
    Dim lngLevel As Long
    Dim strCategory As String

    strPath = Node.FullPath
    lngLevel = UBound(Split(strPath, "\"))
    Select Case lngLevel
        Case 0
            strCategory = "ITALIA"
        Case 1
            strCategory = "ZONA"
        Case 2
            strCategory = "REGIONE"
        Case 3
            strCategory = "PROVINCIA"
        Case 4
            strCategory = "COMUNE"
    End Select
End Sub
Best wishes,
Hans

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

Re: I click on? Treeview

Post by sal21 »

HansV wrote:
24 Jun 2024, 20:15
Air code:

Code: Select all

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
    Dim strPath As String
    Dim lngLevel As Long
    Dim strCategory As String

    strPath = Node.FullPath
    lngLevel = UBound(Split(strPath, "\"))
    Select Case lngLevel
        Case 0
            strCategory = "ITALIA"
        Case 1
            strCategory = "ZONA"
        Case 2
            strCategory = "REGIONE"
        Case 3
            strCategory = "PROVINCIA"
        Case 4
            strCategory = "COMUNE"
    End Select
End Sub
Tks bro.
wORK GREAT!!!