Recent

Author Topic: custom components?  (Read 3131 times)

erkka

  • New Member
  • *
  • Posts: 37
custom components?
« on: August 22, 2010, 06:51:33 pm »
I'm using TStringGrid to display my data, and it works just fine.
The question is, if I wanted to add some new methods to TStringGrid, is there any light-weight way to do it?

If I just use


 type
   TOwnStringGrid (TStringGrid)
      procedure Update(Sender: TObject);
   end;


but then I can't just drag, drop and edit TOwnStringGrid with form designer ?

Making a new component package with a new component sounds a bit like overkill, as I just wanted to add one or two methods to be used only in this one project...

Any ideas to help a noob like me?

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927
Re: custom components?
« Reply #1 on: August 22, 2010, 07:17:53 pm »
Afaik no. Either you access it in code or you install it like
http://wiki.lazarus.freepascal.org/How_To_Write_Lazarus_Component

Btw. your syntax is wrong.
Should be:
TOwnStringGrid = class(TStringGrid)

 

TinyPortal © 2005-2018