How to Place a Control inside a Container Control

Last reviewed: June 21, 1995
Article ID: Q104166
The information in this article applies to:

- Standard and Professional Edition of Microsoft Visual Basic for

  Windows, versions 1.0, 2.0, and 3.0
- Standard and Professional Edition of Microsoft Visual Basic for
  MS-DOS, version 1.0

SUMMARY

To place a control correctly within a container control, use one of the these methods:

  • Select an existing control, and from the Edit menu, choose either Cut or Copy. Then select the container control, and from the Edit menu, choose Paste.
  • Find the icon for the control in the Toolbox. Click it, and then drag a rectangle inside the border of the container. More specifically, click a Toolbox icon, and then release the mouse button. Move the mouse cursor inside the border of the container control. The mouse cursor changes to cross hairs. Now click the mouse button and hold it down. Move the mouse to the bottom right. Then release the mouse button.

You cannot place a control inside a container control by double-clicking an icon in the Toolbox or by dragging a control onto a container control. These actions place the control on the form in front of the container rather than inside the container control.

MORE INFORMATION

Container controls supplied with the standard edition are the frame and picture box. The container controls supplied with the professional edition are the 3-D frame, 3-D panel, and the gauge. These controls can also be placed inside container controls.

When you place a control inside a container control, such as a frame, the containerized control:

  • appears completely within the border of the container control and in front of the background of the container control
  • maintains its position relative to the container control


Additional reference words: 1.00 2.00 3.00 B_VBmsdos
KBCategory: kbenv kbprg
KBSubCategory: EnvtDes


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.