Are you creating the component in code or by dropping it on a form?

If you creating the component in code, you must set the Parent property of the component. Note that this is different from the Owner that you pass to the Create() constructor. If I create a component in code, I always pass nil as the owner.

MyComponent := TMyComponent.Create(nil);
MyComponent.Parent := Panel2;

Now MyComponent will be drawn as a child of Panel2.