Group: Forum Members
Last Active: 14 Years Ago
Posts: 9,
Visits: 1
|
Is there an easy way in the treelist to get the subitem that the user clicked on? I can get the selected item, but have problems retrieving the subitem.
Thanks
Dieter
|
Group: Forum Members
Last Active: Last Month
Posts: 139,
Visits: 184
|
Hello Dieter, You can get the subitem of NTreeList when the user click on it by the following way: //Attach to MouseUp event nTreeList1.MouseUp += new MouseEventHandler(nTreeList1_MouseUp);... void nTreeList1_MouseUp(object sender, MouseEventArgs e){ NTreeListNode node = (NTreeListNode)nTreeList1.ItemFromPoint(new NPoint(e.Location)); for (int i = 0; i < node.SubItems.Count; i++) { Rectangle r = node.SubItems[i].ViewBounds.ToRectangle(); if (r.Contains(e.Location)) { subItem = node.SubItems[i]; return; } } } Regards, Angel.
|