在我的CTreeCtrl,当我展开这是不可见的节点控制自动重新定位树,使展开的节点可见。 有什么办法来防止这种行为?
使用案例:我有一棵树被加载项异步从远程源,并且可以建立树的“底部”相当长的一段时间,目前跳转到,因为它是完成各个节点的树的行为是很分心用户。
目前的解决方法:
/******************************************************************************
Expand an item while retaining the tree position
******************************************************************************/
void CFileOpenTreeView::ExpandWithoutJumping(HTREEITEM hItem)
{
// This still flickers for some reason, but at least it doesn't jump
LockWindowUpdate();
HTREEITEM hFirstVisible = GetTreeCtrl().GetFirstVisibleItem();
GetTreeCtrl().Expand(hItem, TVE_EXPAND);
GetTreeCtrl().SelectSetFirstVisible(hFirstVisible);
UnlockWindowUpdate();
Invalidate();
}