I was wondering if there is a way to add custom method to already existing/included class component in Delphi Pascal.
I would like to use this to rotate StringGrid like this:
StringGridn.rotate(angle);
instead of:
rotate(StringGridn, angle);
Thanks for advice :)
You can use helpers like in example below, see Class and Record Helpers (Delphi).
type
TStringGridHelper = class helper for TStringGrid
procedure Rotate(Angle: Single);
end;
procedure TStringGridHelper.Rotate(Angle: Single);
begin
{ your implementation }
Rotate(Self, Angle);
end;
and then just call
StringGridn.Rotate(Angle);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With