diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index 2f6fdce2e5..ac34a265e1 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -871,6 +871,7 @@ type function GetMaxScrolledLeft : Integer; function GetMaxScrolledTop : Integer; procedure ImageChanged(Sender : TObject); + procedure Loaded; override; procedure WMHScroll(var Msg: TLMScroll); message LM_HSCROLL; procedure WMVScroll(var Msg: TLMScroll); message LM_VSCROLL; protected diff --git a/lcl/include/customlistview.inc b/lcl/include/customlistview.inc index 65a53c5d76..37b430f8e4 100644 --- a/lcl/include/customlistview.inc +++ b/lcl/include/customlistview.inc @@ -654,6 +654,13 @@ begin // end; end; +procedure TCustomListView.Loaded; +begin + // create interface columns if needed + FColumns.IntfCreateColumns; + inherited Loaded; +end; + procedure TCustomListView.SetScrollBars(const AValue: TScrollStyle); begin if (FScrollBars = AValue) then exit; diff --git a/lcl/include/listcolumn.inc b/lcl/include/listcolumn.inc index 76f4ef2d7f..28b2fa5311 100644 --- a/lcl/include/listcolumn.inc +++ b/lcl/include/listcolumn.inc @@ -106,6 +106,7 @@ begin Result := (Collection <> nil) and (TListColumns(Collection).FOwner <> nil) and TListColumns(Collection).FOwner.HandleAllocated + and not (csReading in TListColumns(Collection).FOwner.ComponentState) and not (csDestroying in TListColumns(Collection).FOwner.ComponentState); end;