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

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
 
N

Nicholas Paldino [.NET/C# MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top