Results 1 to 2 of 2

Thread: WATH is the level of treeview element clicked

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,926

    WATH is the level of treeview element clicked

    how to?

  2. #2
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: WATH is the level of treeview element clicked

    Node.Level property. E.g. in NodeClick event.

    VBCCR
    Code:
    #If VBA7 Then
    Friend Property Get FNodeLevel(ByVal Handle As LongPtr) As Long
    #Else
    Friend Property Get FNodeLevel(ByVal Handle As Long) As Long
    #End If
    If TreeViewHandle <> NULL_PTR Then
        Dim hItem As LongPtr, Count As Long
        hItem = SendMessage(TreeViewHandle, TVM_GETNEXTITEM, TVGN_PARENT, ByVal Handle)
        Do While hItem <> NULL_PTR
            Count = Count + 1
            hItem = SendMessage(TreeViewHandle, TVM_GETNEXTITEM, TVGN_PARENT, ByVal hItem)
        Loop
        FNodeLevel = Count
    End If
    End Property

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width