Q:

Creating custom controls. Do I have to give them a name?

Let's say I create (from TPanel) and install my own control. It contains only one button:
constructor TMyPanel.Create(aOwner: TComponent);
begin
 inherited Create(aOwner);

 btn:= TButton.Create(Self);
 btn.Parent:= Self;   
 btn.Name:= 'xxx';      <-------- mandatory?
end;

Is it mandatory to give a name to that panel?

This question started from a comment posted by dummzeuch here: 

This happens when your label doesn't have a name. The IDE adds
  declarations to the class only if the control has got a name (how else
  should it declare it?).

What does a EClassNotFound raised at runtime really mean when the class in question is there at compile and link time, and there explicitly in code?
(I am specifically refer to that comment only)

A:

No, you do not need to name sub components.
However, if you intent on exposing access to a sub componenet as a property that gets streamed in a DFM, you do need to mark the sub component, at least:
constructor TMyPanel.Create(aOwner: TComponent);
begin
  inherited Create(aOwner);
  btn := TButton.Create(Self);
  btn.Parent := Self;
  btn.SetSubComponent(True); // <-- ADD THIS
end;

