Microsoft KB Archive/194033

= PRB: Treeview Node Visible Property Still True When Not Viewable =

Article ID: 194033

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q194033



SYMPTOMS
When a node of a Treeview control is scrolled out of view, the Visible property of the node is still True.



CAUSE
The Visible property of the node indicates that the node is open and visible as part of the tree. It does not indicate if it is viewable in the viewport.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Create a new Standard EXE project in Visual Basic. Form1 is created by default. Select Components from the Project menu. Check the box for "Windows Common Controls," and click OK. Add a Treeview control to Form1.  Double-click on Form1 to bring up the code window and add the following code to Form1: Option Explicit

Private Sub Form_Load TreeView1.Width = 2200  ' so that node 4 is unseen TreeView1.Indentation = 750 TreeView1.Nodes.Add, , , "Node1" TreeView1.Nodes.Add 1, tvwChild,, "Node1-1" TreeView1.Nodes.Add 2, tvwChild,, "Node1-1-1" TreeView1.Nodes.Add 3, tvwChild,, "Node1-1-1-1" TreeView1.Nodes(1).Expanded = True TreeView1.Nodes(2).Expanded = True TreeView1.Nodes(3).Expanded = True DoEvents Debug.Print TreeView1.Nodes(4).Visible End Sub

 Run the project. Note that Node 4's Visible property is True even though the node is not visible through the viewport.</ol>

Additional query words: kbDSupport kbDSD kbVBp kbVBp500 kbVBp600 kbCtrl kbTreeView

Keywords: kbprb KB194033

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.