Dev Treelist 双击获取节点 ,通过FocusedNode获取不可靠

通过Treelist的 CalcHitInfo 方法,返回结果TreeListHitInfo,里面Node即为点击到的节点。

  private void TreeList1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            TreeListHitInfo hitInfo= treeList1.CalcHitInfo(e.Location);
            if (hitInfo.Node != null)
            {
                //hitInfo.Node即为点击到的节点,没有点击到节点的话hitInfo.Node为空 
            }
        }
发布了45 篇原创文章 · 获赞 6 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/sinat_32857543/article/details/102845320