treeview: updating scrollbars on items addition and removal. #35738

git-svn-id: trunk@61437 -
This commit is contained in:
dmitry 2019-06-21 13:53:11 +00:00
parent 2f9ac2ad57
commit 25a5e07eaf

View File

@ -320,7 +320,11 @@ begin
// we must trigger TCustomTreeView.OnDeletion event before
// unbinding. See issue #17832.
if Assigned(Owner) and Assigned(Owner.Owner) then
begin
Owner.Owner.Delete(Self);
Include(Owner.Owner.FStates, tvsScrollbarChanged);;
Owner.Owner.UpdateScrollbars;
end;
// Remove the accessibility object too
if Assigned(Owner) and Assigned(Owner.Owner) then
@ -2339,6 +2343,8 @@ begin
lAccessibleObject.DataObject := Result;
end;
finally
Include(FOwner.FStates, tvsScrollbarChanged);
FOwner.UpdateScrollbars;
// this construction creates nicer exception output
if not ok then
Result.Free;