Udostępnij za pośrednictwem


How to: Reassign Existing Controls to a Different Parent

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

Note

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To reassign existing controls to a different parent

  1. 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

Tasks

Walkthrough: Arranging Controls on Windows Forms Using a TableLayoutPanel

Walkthrough: Arranging Controls on Windows Forms Using Snaplines

Reference

FlowLayoutPanel

TableLayoutPanel

Other Resources

Arranging Controls on Windows Forms