A frame is used to contain other controls. When controls are contained in a frame, you can perform some operations on all these controls during design. For example, the controls are all moved when the frame is moved with their relative positions intact and if the frame is invisible all the contained controls are also invisible. 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.

To create a frame with contained controls

  1. Open the form in Form Designer.

  2. Select the Frame tool, click and drag in the design area to create a frame.

  3. Create the controls that you want to contain in the frame by placing them inside the frame.

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

    NoteNote

    A common change is to remove the caption display by setting the ShowCaption property to No. By default, the border style is Raised. If the frame's purpose is not to distinguish the contained controls, set the Border property to No, so that the border is not displayed.When you drag and drop an existing control inside a frame, it is contained in the frame. When a control is dragged outside a frame, it is no longer contained by the frame. If a container is resized and then overlaps the existing controls completely, these controls will be contained by the frame. If a frame is deleted, all the contained controls are also deleted.

See Also