How to Place a Control inside a Container Control

ID: Q104166


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for Windows, versions 1.0, 2.0, 3.0
  • Microsoft Visual Basic Standard and Professional Editions 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 query words: 1.00 2.00 3.00 B_VBmsdos

Keywords :
Version :
Platform :
Issue type :


Last Reviewed: September 17, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.