Dan SHEA
Dan SHEA

Reputation: 29

Control '' has no parent window : Why is control not named?

I've been tasked with supporting an application that is written in Delphi, which is occasionally crashing with the error message "Control '' has no parent window".

My question is not to understand WHY the error is happening, but to understand why the control has no name assigned.

Is the seeming lack of a name for the control a function of the way the control was coded (i.e., controls can have names but they are optional), or is this because the name of the control is inherited from the (non-existent) parent?

Upvotes: 2

Views: 3103

Answers (2)

Dan SHEA
Dan SHEA

Reputation: 29

There are multiple reasons, including but not necessarily limited to:

1) It wasn't given a name in the code. 2) It doesn't inherit a name for whatever function called it

Upvotes: -1

David Heffernan
David Heffernan

Reputation: 613272

My question is not to understand WHY the error is happening, but to understand why the control has no name assigned.

Controls that are created at runtime, as opposed to design time, need not have names. So, this control has no name because the programmer created it without naming it, or it is a control created internally by another control, without being named.

It is perfectly normal for controls not to be named. It is perfectly reasonable for complex applications never to refer to control names.

Upvotes: 3

Related Questions