How to Place a Control inside a Container Control (104166)



The information in this article applies to:

  • Microsoft Visual Basic Standard Edition for Windows 1.0
  • Microsoft Visual Basic Standard Edition for Windows 2.0
  • Microsoft Visual Basic Standard Edition for Windows 3.0
  • Microsoft Visual Basic Professional Edition for Windows 2.0
  • Microsoft Visual Basic Professional Edition for Windows 3.0
  • Microsoft Visual Basic for MS-DOS

This article was previously published under Q104166

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

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB104166