Quote:
in the onpaint function of my panel i create an instance of my control and i add it to the controls of the panel.
Instead of doing this in OnPaint you should be doing it in OnCreateControl. The OnPaint of which ever class you mentioned.