FIX: TreeView.Visible = False at Design-Time Causes Problems (149278)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q149278 SYMPTOMS
After setting the Visible property of a TreeView control to False at design
time, odd behavior can be exhibited at run time. The reproduction sample at
the end of this article shows two examples. This behavior can range from
the Nodes.Count property returning incorrect values to all or some nodes
not being displayed, and even to GPFs in some cases.
RESOLUTION
The work around for this problem is to not set the Visible property to
False at design time. If a TreeView control needs to be invisible when a
form is shown, the Visible property should be toggled in code before the
form with the TreeView is shown. This can easily be done in the Form_Load
event of the TreeView laden form with this line of code:
TreeView1.Visible = False
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Basic
6.0.
| Modification Type: | Major | Last Reviewed: | 6/28/2004 |
|---|
| Keywords: | kbbug kbfix KB149278 |
|---|
|