How to: Reassign existing controls to a different parent

You can assign controls that exist on your form to a new container control.

  1. In Visual Studio, drag three Button controls from the Toolbox onto the form. Position them near to each other, but leave them unaligned.

  2. In the Toolbox, click the FlowLayoutPanel control icon. (Do not drag the icon onto the form.)

  3. Move the mouse pointer close to the three Button controls.

    The pointer changes to a crosshair with the FlowLayoutPanel control icon attached.

  4. Click and hold the mouse button.

  5. Drag the mouse pointer to draw the outline of the FlowLayoutPanel control.

  6. Draw the outline around the three Button controls.

  7. Release the mouse button.

    The three Button controls are now inserted into the FlowLayoutPanel control.

See also