Stopping Expand/Collpase behaviour whenever you double-click ona Tree Node

  • Thread starter Thread starter Saradhi
  • Start date Start date
S

Saradhi

I am facing a problem with the TreeView in C#.
Whenever I double click on a TreeNode, I am opening another form. This works fine.
But the Treenode is getting expanded and collpased whenever I double click on that TreeNode.
Is there anyway to stop the expand/collapse bahaviour on the double click of a tree Node??



-SARADHI
 
Saradhi,

I would derive a class from the tree view class, and override the
WndProc method. In there, I would handle the windows message for the mouse
double click, and then have it call your function to open a form. If it is
not this message, then just call the base class implementation.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


I am facing a problem with the TreeView in C#.
Whenever I double click on a TreeNode, I am opening another form. This works
fine.
But the Treenode is getting expanded and collpased whenever I double click
on that TreeNode.
Is there anyway to stop the expand/collapse bahaviour on the double click of
a tree Node??

-SARADHI
 
Back
Top