//XtraTreeList没有点击节点的事件是很让人纠结的,而且在右击节点的时候无法进行选中,蛋疼了一段时间后,终于找到了解决方法
private void treeCategory_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
TreeListHitInfo hitInfo = (sender as TreeList).CalcHitInfo(new Point(e.X, e.Y));
TreeListNode node = hitInfo.Node;
if (node != null)
{
treeCategory.FocusedNode = node;
//这里添加一些右击处理代码,例如显示下拉框等
}
}
}
转载于:https://www.cnblogs.com/sunxf2011/archive/2011/08/02/2124880.html