Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxObjectList.FreeAndRemove(TObject) Method

Removes the specified item from the list and destroys it.

#Declaration

Delphi
function FreeAndRemove(AObject: TObject): Integer;

#Parameters

Name Type
AObject TObject

#Returns

Type
Integer

#Remarks

Call this function and pass a stored object as the AObject parameter to destroy the object regardless of the OwnObjects property value. The function returns -1 if the specified object is not within the list or does not exist; otherwise, calls the FreeAndDelete procedure to destroy the object and returns its position (index) within the list.

See Also