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. Image for the cookie policy date

Getting the rect of the plus/minus region in TreeViewAdv?

Hello, Using TreeViewAdv, I want to get the +/- rect of a node; is there a better way to get it than this: Rectangle rect = new Rectangle( node.Bounds.X- node.TreeView.GutterSpace, node.Bounds.Y, node.TextAndImageBounds.X-2, node.TextAndImageBounds.Height); I modify the rect using GutterSpace and 2 because this expands the rect to include the boundary that behaves like the +/- but visually isn''t. I''m concerned that font and/or icon changes might invalidate these adjustments. Not GutterSpace so much, but the padding between the +/-; is there a property that returns this? I couldn''t find one. It might also be nice if there was a node property that returned the actual +/- rect, and perhaps even the visual +/- rect also. Thanks. Keith

1 Reply

AD Administrator Syncfusion Team May 4, 2005 02:52 PM UTC

Hi Keith, The following code should provide the coordinates of the top-left corner of the collapse button of a TreeNodeAdv in terms of screen coordinates : Point point = this.treeViewAdv1.PointToScreen(this.treeViewAdv1.NodeToPoint(node)); point = new Point (point.X+node.NodeX, point.Y); Please refer to the test sample attached that illustrates this. Here the mouse cursor gets positioned appropriately when the buttons are clicked. Let me know if this works for you. We have considered this as a feature request (feature# 188) and will add a CollapseButtonRectangle property to the TreeNodeAdv in the near future. We appreciate your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Live Chat Icon For mobile
Up arrow icon