Acessing Protected Members of an Object
Usually, you can't access protected members of an object. But Delphi let you access protected members if the object is defined in the same unit. So you can define a derived object and typecast where you want to use the protected member. It's something like this:
THackControl = class(TCustomEdit)
end;
After defining this class, you can access all protected members of TCustomEdit, with objects of derived classes with a code like this:
THackControl(MyEdit).Color := clBlack;

0 Comments:
Post a Comment
<< Home