RAD Studio VCL Reference
TComponent.ValidateInsert Method

Provides the interface for a method that validates an child component before it is inserted.

procedure ValidateInsert(AComponent: TComponent); dynamic;
__fastcall ValidateInsert(TComponent * AComponent);

ValidateInsert does nothing in TComponent. Descendant classes can override it to disallow a component from accepting an object as a child. By default ValidateInsert allows any object to be inserted into the component.  

If a component needs to validate only certain objects, descendant classes can override ValidateInsert to filter out those objects. To disallow an insertion, raise an exception in the derived method. 


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!