Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

C# WinForms: I can not override OnNodeMouseDoubleClick event for a TreeView

I created a new object which inherits from the TreeView I created in the designer.  In the C#, I:

- hide that TreeView
- I construct a new TreeView based on the child class
- assign the value to it from the designer TreeView, to save work for myself
- I show the new TreeView and add it to the Controls list for the form


But, when I double click a collapsed node it expands the node before hitting the breakpoint in my overriden function:

        protected override void OnNodeMouseDoubleClick(TreeNodeMouseClickEventArgs e)
        {
        base.OnNodeMouseDoubleClick(e);
        }

I want to stop the collpase expand behavior and get that under my control, so I can only expand/collapse when I choose to.

What am I doing wrong?
ASKER CERTIFIED SOLUTION
Avatar of Naman Goel
Naman Goel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

Thanks!