From ccfb61ca9c4878bf1c8cfbed21d9ed5d1a9da4d5 Mon Sep 17 00:00:00 2001 From: Joachim Marder Date: Thu, 13 Apr 2023 15:24:16 +0200 Subject: [PATCH] Fixed issue #1187 --- Source/VirtualTrees.StyleHooks.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/VirtualTrees.StyleHooks.pas b/Source/VirtualTrees.StyleHooks.pas index 8213b7223..0e06a6803 100644 --- a/Source/VirtualTrees.StyleHooks.pas +++ b/Source/VirtualTrees.StyleHooks.pas @@ -195,8 +195,6 @@ procedure TVclStyleScrollBarsHook.CalcScrollBarsRect(); constructor TVclStyleScrollBarsHook.Create(AControl: TWinControl); begin inherited; - InitScrollBars; - {$ifdef NOT_USE_VCL_STYLEHOOK} VertSliderState := tsThumbBtnVertNormal; VertUpState := tsArrowBtnUpNormal; @@ -244,6 +242,9 @@ procedure TVclStyleScrollBarsHook.UpdateScroll; PaddingSize: Integer; BorderSize: Integer; begin + if VertScrollWnd = nil then + InitScrollBars(); + HeaderHeight := 0; if (hoVisible in TBaseVirtualTree(Control).Header.Options) then Inc(HeaderHeight, TBaseVirtualTree(Control).Header.Height);