I have a class that derives from Twincontrol. I want to read controls font, caption, and width but all these properties are protected, So i cannot read them directly.To read these property i have created a class as show below
TTest = class(TWinControl)
public
procedure test(A: TWinControl);
end;
procedure TTest.test(A: TWinControl);
var
width: integer;
text: string;
begin
width := A.width; // cannot access
text := a.caption; //cannot access
end;
calling this function
ABC := TTest.create(nil);
Abc.Test(twincontrol(Tbutton));
How can i access these properties? Do i have to derived class from other base class? i want to read these properties at top most level as possible.