Вниз
Скачать: CL | DM;

HasProperty ???   Найти похожие ветки 

 
Serghei   (2003-02-17 15:26) [0]

как узнать есть определенный Property некой компоненте в Ран-тайме
типа If TControl(...) HasProperty("***") then...


 
Игорь Шевченко ©   (2003-02-17 15:29) [1]

Например:
var
propInfo: PPropInfo;
thisFont: TFont;
begin
Result := 0;

propInfo := GetPropInfo(AControl.ClassInfo, "Font");

if propInfo <> nil then begin
thisFont := TFont(GetObjectProp(AControl, "Font"));

if Assigned(thisFont) then
with TControlCanvas.Create do
try
Control := AControl;
Font.Assign(thisFont);
Result := TextWidth(AText);
finally
Free;
end;
end;


 
Silver_   (2003-02-17 15:42) [2]

Игорь Шевченко ©

Пасиба по Хелпу искал не там. Еще раз сенькс.


 
Юрий Зотов ©   (2003-02-17 22:21) [3]

Начиная с D5 в TypInfo есть готовая функция IsPublishedProp.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.01 c
3-87263
KonuhovSegey
2003-02-04 18:19
2003.02.27
Запрос на Update для TIBDataSet


6-87605
kolerkow
2003-01-09 23:50
2003.02.27
e-mail


14-87712
Rustiik
2003-02-12 10:58
2003.02.27
Архивация БД


7-87729
kuzmich
2002-12-26 18:42
2003.02.27
Эмулятор папки


1-87506
littlelove
2003-02-15 22:44
2003.02.27
ToolBar ->ToolWindow




   Наверх