RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TObject::InheritsFrom Method

Determines the relationship of two object types.

Pascal
class function InheritsFrom(AClass: TClass): Boolean;
C++
Boolean InheritsFrom(TClass AClass);

Use System::TObject::InheritsFrom to determine if a particular class type or object is an instance of a class or one of its descendants. System::TObject::InheritsFrom returns true if the object type specified in the aClass parameter is an ancestor of the object type or the type of the object itself. Otherwise, it returns false.

Note: System::TObject::InheritsFrom is similar to the Delphi is operator, but applies to class references.
Note: In C++ code, a non-static version of System::TObject::InheritsFrom is provided. This call is useful in determining whether a descendant class method or property can be used, given a variable of a base class. For example, use System::TObject::InheritsFrom to determine whether the Sender parameter in an event handler is of a particular class type or one of its descendants.
 

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