diff --git a/lcl/shellctrls.pas b/lcl/shellctrls.pas index 72d7d1a1dd..f9eee38517 100644 --- a/lcl/shellctrls.pas +++ b/lcl/shellctrls.pas @@ -617,9 +617,14 @@ begin if not Result then exit; OldAutoExpand:=AutoExpand; AutoExpand:=False; - Node.DeleteChildren; - Result := PopulateTreeNodeWithFiles(Node, GetPathFromNode(Node)); - AutoExpand:=OldAutoExpand; + BeginUpdate; + try + Node.DeleteChildren; + Result := PopulateTreeNodeWithFiles(Node, GetPathFromNode(Node)); + AutoExpand:=OldAutoExpand; + finally + EndUpdate; + end; end; constructor TCustomShellTreeView.Create(AOwner: TComponent);