diff --git a/lcl/include/customlistbox.inc b/lcl/include/customlistbox.inc index 651e2b2dfd..e9918b0bf9 100644 --- a/lcl/include/customlistbox.inc +++ b/lcl/include/customlistbox.inc @@ -267,10 +267,10 @@ end; function TCustomListBox.GetScrollWidth: Integer; begin + Result := FScrollWidth; + if (Result > 0) or (csDesigning in ComponentState) then Exit; if HandleAllocated then - Result := TWSCustomListBoxClass(WidgetSetClass).GetScrollWidth(Self) - else - Result := FScrollWidth; + Result := TWSCustomListBoxClass(WidgetSetClass).GetScrollWidth(Self); end; {------------------------------------------------------------------------------