use typinfo
procedure GetEnumInfo;
var
OrdTypeInfo: PTypeInfo;
OrdTypeData: PTypeData;
TypeNameStr: String;
TypeKindStr: String;
MinVal, MaxVal: Integer;
EnumCount: integer;
begin
// Get the TTypeInfo pointer
OrdTypeInfo := TypeInfo(TFormStyle)
// Get the TTypeData pointer
OrdTypeData := GetTypeData(OrdTypeInfo);
// Get the type name string
TypeNameStr := OrdTypeInfo.Name;
// Get the type kind string
TypeKindStr := GetEnumName(TypeInfo(TTypeKind), Integer(OrdTypeInfo^.Kind));
// Get the minimum and maximum values for the type
MinVal := OrdTypeData^.MinValue;
MaxVal := OrdTypeData^.MaxValue;
EnumCount := MaxVal - MinVal;
end;