steward%40manscat.com">steward
manscat.com wrote:
> DELPHI 5
>
> PROBLEM
> I have managed to lose the name property of my custom control?
> IE:
>
> if ActiveControl=MyControl then
> print('This never gets executed even when ActiveControl is MyControl');
How do you know?
How do you know that ActiveControl is MyControl if a conditional statement
fails, indicating that ActiveControl *isn't* MyControl?
Where are those two identifiers declared? (Ctrl+Click on them; don't
assume you know where they're declared.) Where do they get assigned?
Can you write a minimal program that reproduces the error, and then post
the code here?
> print(ActiveControl.Name); // this is blank
What do you expect it to print instead?
> The control derives from TCustomControl, and does not muck/change with any
> name properties.
If you're not changing the Name property, then it will always have its
default empty value. It's the IDE that names your components when you drop
them in the designer. Merely creating an instance doesn't give it a name.
The IDE-given names are restored when a form gets loaded.
--
Rob
.