That's one way to do it, yes. Another way would be to use a Panel instead of
a PictureBox and, since I assume that you were setting an image to be
displayed through the PictureBox, painting the image yourself through the
Panels Paint event. Then you could add the child Panels to the Panel that is
custom painted. This way if you ever needed to move the parent Panel then
you know that the child Panels will automatically follow and you won't be
required to move them as well, as will be case if you parent these Panels to
the Form.
--
Tim Wilson
..Net Compact Framework MVP
"Eric Seneca" <(E-Mail Removed)> wrote in message
news

CFoe.62011$(E-Mail Removed)...
> Tim Wilson wrote:
> > So you're looking to create a control and add it to another control as a
> > child? If you look at the InitializeComponent method that is controlled
by
> > the designer you can see how controls are created and added as children
to
> > other controls. Although I don't believe that the PictureBox is an
allowable
> > container. In other words, if you attempt to add a control to the
Controls
> > collection of a PictureBox I believe you will be met with an exception.
> >
> humm i see what you are saying to get aroudn this i set a picture box
> and create panels dynamically via code and set the parent of that code
> to the actualy form the picture boxe is on. The i bring the panel to the
> front with a color and i have it in the contain frmMain...
>
> Thanks..