Frame Control

Frame controls are used to provide an identifiable grouping for other controls. For example, you can use frame controls to subdivide a form functionally—to separate groups of option button controls.

In most cases, you will use the frame control passively—to group other controls—and will have no need to respond to its events. You will, however, most likely change its Name, Caption, or Font properties.

Syntax

CommandButton

The Frame control has the following properties, methods, and events.

Properties Methods Events
Appearance Move Click
BackColor, ForeColor Refresh DblClick
BorderStyle ZOrder MouseDown, MouseUp
Caption MouseMove
ClipControls
Container
Enabled
Font
FontBold
FontItalic
FontStrikethru
FontUnderline
FontName
FontSize
Height, Width
HWnd
Left, Top
Name
Parent
TabIndex
Tag
Visible

Remarks

When using the Frame control to group other controls, first draw the frame control, and then draw the controls inside of it. This enables you to move the frame and the controls it contains together.

To add other controls to the frame, draw them inside the frame. If you draw a control outside the frame, or use the double-click method to add a control to a form, and then try to move it inside the Frame control, the control will be on top of the frame and you'll have to move the frame and controls separately.

To select multiple controls in a frame, hold down the CTRL key while using the mouse to draw a box around the controls.