RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TypInfo.PropType Function

Retrieves a component's property type.

Pascal
function PropType(Instance: TObject; const PropName: string): TTypeKind; overload;
function PropType(AClass: TClass; const PropName: string): TTypeKind; overload;
C++
TTypeKind PropType(TObject * Instance, const AnsiString PropName);
TTypeKind PropType(TClass AClass, const AnsiString PropName);

PropType utilises Delphi's RTTI (Run Time Type Information) to return the type of a component property in a TTypeKind value.  

In the first form of this function, AClass specifies the component class whose property you want to retrieve. PropName specifies the property name as a string.  

The second form of the function is similar to the first, with Instance replacing AClass as the means of specifying the component.  

In both forms of the function, the returned value is a TTypeKind value.

Note: If the specified property does not exist, or is not a published property, an EPropertyError exception is thrown.
 

 

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