Hi Rama!
Thanks for your answer.
Actually I’m already using a very similar code to the one you posted.
However I noticed that InitializeComponent doesn’t gets called when components are created that way (even if bWantsInitializeComponent is set to true), which made me think that maybe there’s some other steps missing too and made me unconfident to follow that method.
That’s why I was asking for the “correct way” or some kind of built-in function.
My fault for not being more explicit in my answer. Sorry.