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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

way to detecting the click event

Thread ID:

Created:

Updated:

Platform:

Replies:

38695 Dec 16,2005 09:11 AM UTC Dec 28,2005 06:24 AM UTC WinForms 4
loading
Tags: Tools
David
Asked On December 16, 2005 09:11 AM UTC

Hi All, I am using 3.301.0.0. Can I detect whether the image on the left side of the node''s text was clicked on? Thanks. Regards, David

Deepa TS [Syncfusion]
Replied On December 16, 2005 11:09 AM UTC

Hi David, The answer for your question is Yes.You could do so by handling the TreeViewAdv''s MouseUp event as shown below : private void treeViewAdv1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { TreeNodeAdv node = this.treeViewAdv1.SelectedNode; Point imgpt = new Point(node.TextAndImageBounds.X, node.TextAndImageBounds.Y); Size imgSize = new Size(this.imageList1.ImageSize.Width, this.imageList1.ImageSize.Height); Rectangle imgrec = new Rectangle(imgpt, imgSize); Point clickpt = new Point(e.X, e.Y); if (imgrec.Contains(clickpt)== true) { Console.WriteLine("Clicked on " + node.Text + "''s left image"); } } Please take a look at the attached sample and let me know if this meets your requirement. Thanks for your interest in Syncfusion Products. Regards, Deepa.T.S

LeftClickPoint.zip

Administrator [Syncfusion]
Replied On December 21, 2005 06:25 AM UTC

Hi, It works fine Deepa. But gotta to know whether i will be able to detect the click point on right image in the same way as left image. Thanks. Regards, David.

Deepa TS [Syncfusion]
Replied On December 21, 2005 07:04 AM UTC

Hi David, Thanks for the update. Again the answer for your question is Yes.You could do so by handling the same TreeViewAdv''''s MouseUp event as shown below : private void treeViewAdv1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { TreeNodeAdv node = this.treeViewAdv1.SelectedNode; Point imgpt= new Point (node.RightImagesX, node.TextBounds.Y); Size imgSize = new Size(this.imageList1.ImageSize.Width, this.imageList1.ImageSize.Height); Rectangle imgrec = new Rectangle(imgpt, imgSize); Point clickpt = new Point(e.X, e.Y); if (imgrec.Contains(clickpt)== true) { MessageBox.Show("Clicked on " + node.Text + "''s right image"); Console.WriteLine("Clicked on " + node.Text + "''s right image"); } } Please take a look at the attached sample and let me know if this meets your requirement. Thanks for your continued interest in Syncfusion Products. Regards, Deepa.T.S

RightImageClick.zip

Administrator [Syncfusion]
Replied On December 28, 2005 06:24 AM UTC

Hi Deepa, Thanks for your help and support. It works.. Regards, David

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.

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

;