Extend the library class with your own method in Delphi Pascal

I would like to know if there is a way to add custom methods for existing/included class components in Delphi Pascal.

I want to use it to look like Rotate StringGrid like this:

StringGridn.rotate(angle);

Replace:

rotate( StringGridn, angle);

Thank you for your suggestion:)

you can Use the helper in the 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;

Then call

StringGridn.Rotate(Angle);

I want to know if there is a way to add custom methods for existing/included class components in Delphi Pascal.

I want to use it to rotate StringGrid like this :

StringGridn.rotate(angle);

Replace:

rotate(StringGridn, angle );

Thank you for your suggestion:)

You can use the helper in the example below, please refer to 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;

Then call

StringGridn.Rotate(Angle);

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3183 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.