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....
...
I click on? Treeview
-
- Administrator
- Posts: 79443
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: I click on? Treeview
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
Hans
-
- PlatinumLounger
- Posts: 4495
- Joined: 26 Apr 2010, 17:36
Re: I click on? Treeview
Tks bro.HansV wrote: ↑24 Jun 2024, 20:15Air 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
wORK GREAT!!!