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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Sync between click event and cursor position in treeview

Thread ID:





41454 Mar 2,2006 07:03 AM UTC Mar 17,2006 03:04 PM UTC WinForms 2
Tags: Tools
Administrator [Syncfusion]
Asked On March 2, 2006 07:03 AM UTC

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 09:58 AM UTC

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.


Administrator [Syncfusion]
Replied On March 17, 2006 03:04 PM UTC

Thanks for the idea!!!


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon