Hi Eugene,
You could use the Left Image and Right Image of a node as a clickable area to use it as a button associated with that particular tree node. Following is the code snippet that illustrates this:
private void treeViewAdv1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
Point clickpt = new Point(e.X, e.Y);
TreeNodeAdv node = this.treeViewAdv1.PointToNode( clickpt );
string aText;
aText = node.Text;
//To check whether mouse clicking on the left image.
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);
if (imgrec.Contains(clickpt)== true)
{
Console.WriteLine("Clicked on " + node.Text + "''''s left image");
}
//To check whether the mouse clicking on the RightImage point.
Point imgpt1 = new Point (node.RightImagesX,node.TextBounds.Y);
Size imgSize1 = new Size(this.imageList2.ImageSize.Width, this.imageList2.ImageSize.Height);
Rectangle imgrec1 = new Rectangle(imgpt1, imgSize1);
if (imgrec1.Contains(clickpt)== true)
{
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. If not, please provide more details regarding this issue and modify the attached sample and send it over to me.
Thanks for using Syncfusion products.
Regards,
Vijay
TreeViewAdv