We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

TreeView DoubleClick: Change Behavior

dastrw
dastrw asked
on
Medium Priority
439 Views
Last Modified: 2013-12-25
I need to change the behavior when I double-click on a node in tree view.

When a user double-clicks on any node in the tree, that element is added to a list.

Whatever the state of the node is before the double-click I want that to remain the same after the double-click.  So if the node is expanded I want it to stay expanded and if the node is collapsed I want it to stay collapsed.

How do I do this?

Currently my code adds the element to the list but the state of the node changes which is a bit confusing to the user.

Thanks.
Comment
Watch Question

You can subclass it

TVEventCancel: Demonstrates how to prevent a Node selection change, expand, and collapse in the Comctl32.ocx TreeView control

http://btmtz.mvps.org/treeview/

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
computron, you've really gone into over drive this month on the answering questions....


Computron has provided a good suggestion: subclass. However, you should understand the problems that can arise from subclassing such as: It makes it extremly difficult to debug your applications. Perhaps you should consider a more robust tree view control. Such as one from VBAccelerator.


Brian
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.