Can you disable the Treeview double-click expanding of nodes?

Posted on 2008-11-13
Last Modified: 2013-12-26
Using Windows.Forms Treeview, I am trying to do some custom action with a treeview when a node is double-clicked.  The problem is that even when I don't have my own doubleclick event handler, the Treeview uses the double-click to automatically expand or contract an expandable node.  Is there a way to turn off this behavior?  It would be ideal if the nodes would only expand/contract if the +/- box on the node were clicked, and the double-click could be for the custom action. There is no SelectAction available since this is Windows.Forms and not a Web.UI.WebControl
MyNode = New TreeNode

                MyNode.Name = "S" & CStr(dr.Item(0))

                MyNode.Text = dr.Item(2)

                MyNode.Tag = "SECTION-" & dr.Item(2)


                MyNode = Nothing

Open in new window

Question by:srbentley
    LVL 13

    Expert Comment


    Author Comment

    There is no Expanded property in a VB.NET Windows Control Treeview Node.
    LVL 13

    Accepted Solution


    Author Closing Comment

    Thanks.. That's exactly I needed and couldn't find.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    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…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now