thank for your help.
just for general knowledge i would like to know why the onpaint of the panel is called automatically when i add it to the controls of the form and the onpaint of the control does not work when i add it to the controls of the panel.