我有一个派生自Tobject的类.在我的课堂上,我想使用受保护的控制属性.这是我的代码
type
THack = class(Tcontrol);
TMyClass = class(TObject)
private
A: string;
B: string;
C: string;
D: string;
public
procedure DoSomthing(MyForm: TForm);
end;
procedure TMyClass.DoSomthing(MyForm: TForm);
var
I: Integer;
begin
for I := 0 to MyForm.ControlCount - 1 do
begin
// I want to read Font property
showmessage(inttostr(THack(MyForm.Controls[I]).Font.Size));
end;
end;
Run Code Online (Sandbox Code Playgroud)
有没有其他方法可以访问受保护的属性
我所知道的可以执行此任务的选项是:
| 归档时间: |
|
| 查看次数: |
789 次 |
| 最近记录: |