We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Sync between click event and cursor position in treeview

Thread ID:

Created:

Updated:

Platform:

Replies:

41454 Mar 2,2006 02:03 AM Mar 17,2006 10:04 AM Windows Forms 2
loading
Tags: Tools
Administrator [Syncfusion]
Asked On March 2, 2006 02:03 AM

Hi, I have a tree control with me. My idea is that when I click a button the cursor position should be placed in the respective node i.e if I am clicking the button node1 I have to get the above behaviour on node1. Awaiting your useful suggestion. Thanks, regards, Ben

Deepa TS [Syncfusion]
Replied On March 2, 2006 04:58 AM

Hi Ben, Please refer to the attached sample that illustrates the above. Here the mouse cursor gets positioned appropriately when the buttons are clicked. //Provides the coordinates of the top-left corner of a TreeNodeAdv in terms of screen coordinates. private Point MousePointer(TreeNodeAdv node) { Point point = this.treeViewAdv1.PointToScreen(this.treeViewAdv1.NodeToPoint(node)); point = new Point (point.X+node.NodeX, point.Y); return point; } //coding for the cursor position on a node when a button is clicked. private void button1_Click(object sender, System.EventArgs e) { Cursor.Position = this.MousePointer (this.treeViewAdv1.Nodes[0]); } Let me know if this helps you.Thanks for your continued interest in Syncfusion Products. Kind regards, Deepa.T.S.

MousePosition.zip

Administrator [Syncfusion]
Replied On March 17, 2006 10:04 AM

Thanks for the idea!!!

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;