RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TComponent.ValidateInsert Method

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

Pascal
procedure ValidateInsert(AComponent: TComponent); dynamic;
C++
__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) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!