Tree to work just like the left mouse button.

Hi, In the treeviewadv right button moves a selection to the node I click on. But this selection will look normal the next second.. I want the tree to work just like the left mouse button. Thanks. Regards, Andrew.

2 Replies

DT Deepa TS Syncfusion Team January 6, 2006 02:32 PM UTC

Hi Andrew, According to my understanding,you need to select the node when the mouse is RightClicked as same as when the mouse is LeftClicked. You could do so by handling MouseDown event of treeViewAdv. private void treeViewAdv1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Right) { Point p = this.treeViewAdv1.PointToClient(Control.MousePosition); TreeNodeAdv node = this.treeViewAdv1.PointToNode(p); this.treeViewAdv1.SelectedNode = node; } } Please take a look at the attached sample and let me if this helps you. Thanks for your interest in Syncfusion products. Regards, Deepa.T.S

RightSelection.zip


AD Administrator Syncfusion Team January 6, 2006 08:37 PM UTC

Hi Andrew, You can also use the RMouseDownNode property instead of using the PointToClient/PointToNode logic. Regards, Gregory Austin Syncfusion Inc.

Loader.
Up arrow icon