A frame is used for containing other controls. When controls are contained in a frame, you can perform some operations on these controls as a whole. For example, during the design process, controls move when the frame moves, with their relative positions intact. If the frame is not displayed to the user, all the contained controls are not displayed either.. A frame can have a border that can be raised or lowered. This feature can be used to visually distinguish a group of controls, such as a group of option buttons.

You can hide the caption form by setting the ShowCaption property to No. By default, the border style is Raised. If you do not want to distinguish the contained controls, you can set the Border property to No, and no border is displayed.

When you use a drag-and-drop operation to move an existing control inside a frame, it is contained by the frame. When you use drag-and-drop to move a control outside a frame, it is no longer contained by the frame.

If a container is resized and overlaps some existing controls completely, these controls become contained. If a frame is deleted, all the controls that it contained are deleted.

To create a frame with contained controls

  1. Open the form in Form Designer.

  2. Open the Toolbox and select the Frame tool.

  3. Click and drag in the design area to create a frame.

  4. Create the controls that you want to contain in the frame in the usual way, placing them inside the frame just as you would add them to the form.

  5. Set the properties of the frame to suit your needs.

See Also