Delphi/꿀팁
타입캐스트 없이 컴포넌트 한번에 컨트롤하기 - 1
- Delphi 2010 이상uses .., Rtti;procedure ChangeValue(obj: TObject);var Context : TRttiContext; I : Integer;begin with Context.GetType(obj.ClassType) do begin for I := Low(GetProperties) to High(GetProperties) do //클래스의 프로퍼티를 모두 가져옵니다. begin if (GetProperties[i].Name = 'Text') or //원하는 프로퍼티를 찾습니다. (GetProperties[i].Name = 'Caption') then begin GetProperties[i].SetValue(obj, 'Test!'); //프로퍼티에 값을 넣습..