|
How do I detect which TreeNode in my TreeView was DoubleClicked?
I can detect which TreeNode was right clicked using this code (where treeMain is the TreeView control):
private void treeView_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { if(e.Button == MouseButtons.Right) { TreeNode oTreeNode = this.treeMain.GetNodeAt(e.X, e.Y); if(oTreeNode != null) { // display context menu treeMain.SelectedNode = oTreeNode; this.contextMenuTree.Show(this.treeMain, new Point(e.X, e.Y)); } } }
...but the DoubleClick event has different arguments passed to it so e.X and e.Y won't compile.
Thanks in advance,
Chiz. |