[Lazarus] Invalid component names

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Apr 26 23:10:58 CEST 2009


On Sun, 26 Apr 2009 19:54:58 +0200
Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:

> Gabor Boros schrieb:
> 
> > Dynamically created components have empty name after creation on
> > Win32 too. This thing is true for Delphi too. This is normal I
> > think.
> 
> Right, I was misleaded by different settings in my various test 
> projects. Only forms get an unique name, and this works in Lazarus as 
> well as in Delphi.
> 
> So the remaining question is: How to assign unique names to
> dynamically created components? Does there exist an immediately
> usable method or function?
> 
> Empty names seem to be harmless, but every attempt to assign an 
> non-empty and already used name to a component results in an
> exception.
> 
> What's the scope (list of names...), within which every component
> must have an unique name?

Have you looked at TComponent.SetName?

Mattias



More information about the Lazarus mailing list