The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

Archive for May 7th, 2009

Delphi – class helper to add for … in support for TComponent.Components / ComponentCount

Posted by jpluimers on 2009/05/07

You might have discovered that I’m a fan of Delphi class helpers.

This is another case where I’d like to use the for … in statement: accessing the Components of a TComponent instance.

So I wanted to end up with this:

procedure MyForm.FormCreate(Sender: TObject);
var
  Component: TComponent;
begin
  for Component in Self do
  begin
  // business logic goes here
  end;
end;

Read the rest of this entry »

Posted in Component Development, Delphi, Development | 12 Comments »