diff --git a/contrib/src/gizmos/splittree.cpp b/contrib/src/gizmos/splittree.cpp index 709d86f729..00f6902a03 100644 --- a/contrib/src/gizmos/splittree.cpp +++ b/contrib/src/gizmos/splittree.cpp @@ -311,7 +311,7 @@ void wxRemotelyScrolledTreeCtrl::AdjustRemoteScrollbars() if (scrolledWindow) { wxRect itemRect; - if (GetBoundingRect(GetRootItem(), itemRect)) + if (GetBoundingRect(GetFirstVisibleItem(), itemRect)) { // Actually, the real height seems to be 1 less than reported // (e.g. 16 instead of 16) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index bfe95ab1f7..5dcb0867c0 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1921,6 +1921,13 @@ bool wxTreeCtrl::GetBoundingRect(const wxTreeItemId& item, bool textOnly) const { RECT rc; + + // Virtual root items have no bounding rectangle + if ( IS_VIRTUAL_ROOT(item) ) + { + return false; + } + if ( TreeView_GetItemRect(GetHwnd(), HITEM(item), &rc, textOnly) ) {