Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB6
Expertise: Intermediate
Aug 1, 2002

EnsureNodeIsVisible - Select a TreeView node and ensure it is visible

' select a treevide node and ensure it is visible
' by expanding all its parent nodes and bringing the node
' in the visible portion of the control

Sub EnsureNodeIsVisible(ByVal node As TreeNode)
    Dim tvw As TreeView = node.TreeView
    tvw.SelectedNode = node
    ' expand this node and all its ancestors
    Do Until node.Parent Is Nothing
        node = node.Parent
        node.Expand()
    Loop
    tvw.SelectedNode.EnsureVisible()
End Sub
Francesco Balena
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date