- Код: Выделить всё
Procedure GetProperties( Kinds: TTypeKinds; Source: TPersistent; List: TStrings);
var
pList: PPropList;
Total, Props, i: Integer;
begin
Total := GetTypeData(Source.ClassInfo).PropCount;
GetMem(pList, sizeof(PPropInfo) * Total);
try
Props := GetPropList( Source.ClassInfo, Kinds, pList );
for i := 0 to Props-1 do
begin
List.AddObject(pList[i].Name, TObject(pList[i]) );
end;
finally
FreeMem(pList, sizeof(PPropInfo) * Total);
end;
end;
Затем использую -
- Код: Выделить всё
PropList:=TStringList.Create;
curitem:=TPersistent(Sender);
GetProperties([tkInteger,tkString, tkChar, tkEnumeration, tkFloat,
tkSet, tkWChar, tkLString,tkUString,tkUChar, tkWString,
tkVariant, tkArray, tkInt64 ],curitem, PropList);
PropList.SaveToFile('C:/test.txt');
Смотрю вывод, а там только часть свойств компонента:
- Код: Выделить всё
Align
AlphaBlendValue
Anchors
BiDiMode
BorderIcons
BorderStyle
BorderWidth
ClientHeight
ClientWidth
Color
Cursor
DefaultMonitor
DragKind
DragMode
FormStyle
Height
HelpContext
HelpType
Left
PixelsPerInch
PopupMode
Position
ShowInTaskBar
Tag
Top
Width
WindowState