Solved

Preventing a TreeView control  from collapsing other nodes when selecting new node.

Posted on 2003-10-27
2
401 Views
Last Modified: 2013-12-26
I am getting increasingly frustrated by a peculiar (seemingly default) behavior of the TreeView control (Common Controls 6 version).

Say for example I create a tree with 3 nodes at the root level and 3 child nodes for each parent node. I run the project and use the + / - symbols to expand all three parent nodes. As soon as I click on one of the child nodes, the parent nodes of the other child nodes automatically collapse, leaving the minimum number of expanded nodes needed to provide a path to the selected node.

This behavior doesn't seem to exist in any program on the market which uses TreeViews, even Windows Explorer, but I can't for the life of me work out how to prevent it. Surely this must be driving other developers mad, and yet I can find nothing about it anywhere on the web. Please help!

Behaviour definitely occurs under Windows 2000 and XP using Visual Basic 6, Service Pack 5.
0
Comment
Question by:wwarby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
appari earned 250 total points
ID: 9630855

i think your treeview controls SingleSel property is set to true. change it to false and check.
0
 
LVL 1

Author Comment

by:wwarby
ID: 9630919
Absolutely correct. I can't believe I didn't check what that property actually did - it just seemed so obvious... SingleSel, prevent multiple nodes from being selected at the same time, like the MultipleSelection property of the ListView control. Why they hell did Microsoft call is SingleSel anyway? Thanks a lot mate, you've put 6 months of frustration to sleep in a single sentence. Points well deserved, however easy the answer ended up being!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Macro Excel - Multiple If conditions 2 94
RUNRMTCMD from AS/400 13 129
VB6 - Cannot type when doing an extract from MSHFlexgrid to Excel 6 47
2 Global Vars, 1 List Box 4 32
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question