Frame Control

Description

Creates a functional and visual control group.

Remarks

All option buttons in a Frame are mutually exclusive, so you can use the Frame to create an option group. You can also use a Frame to group controls with closely related contents. For example, in an application that processes customer orders, you might use a Frame to group the name, address, and account number of customers.

You can also use a Frame to create a group of toggle buttons, but the toggle buttons are not mutually exclusive.

The default event for a Frame is the Click event.

Properties

ActiveControl property, BackColor property, BorderColor property, BorderStyle property, CanPaste property, CanRedo property, CanUndo property, Caption property, ControlTipText property, Cycle property, DrawBuffer property, Enabled property, Font object, ForeColor property, Height, Width properties, HelpContextID property, InsideHeight, InsideWidth properties, KeepScrollBarsVisible property, LayoutEffect property, Left, Top properties, MouseIcon property, MousePointer property, Name property, Object property, OldHeight, OldWidth properties, OldLeft, OldTop properties, Parent property, Picture property, PictureAlignment property, PictureSizeMode property, PictureTiling property, ScrollBars property, ScrollHeight, ScrollWidth properties, ScrollLeft, ScrollTop properties, SpecialEffect property, TabIndex property, TabStop property, Tag property, VerticalScrollbarSide property, Visible property, Zoom property.

Methods

Copy method, Cut method, Move method, Paste method, RedoAction method, Repaint method, Scroll method, SetDefaultTabOrder method, SetFocus method, UndoAction method, ZOrder method.

Events

AddControl event, BeforeDragOver event, BeforeDropOrPaste event, Click event, DblClick event, Enter, Exit events, Error event, KeyDown, KeyUp events, KeyPress event, Layout event, MouseDown, MouseUp events, MouseMove event, RemoveControl event, Scroll event, Zoom event.

See Also

Controls collection, GroupName property.

Example

The following example uses the Zoom property to shrink or enlarge the information displayed on a form, Page, or Frame. This example includes a Frame, a TextBox in the Frame, and a ScrollBar. The magnification level of the Frame changes through Zoom. The user can set Zoom by using the ScrollBar. The TextBox is present to demonstrate the effects of zooming.

This example also uses the Max and Min properties to identify the range of acceptable values for the ScrollBar.

To use this example, copy this sample code to the Declarations portion of a form. Make sure that the form contains:

  • A Label named Label1.
  • A ScrollBar named ScrollBar1.
  • A second Label named Label2.
  • A Frame named Frame1.
  • A TextBox named TextBox1 that is located inside Frame1.
    Private Sub UserForm_Initialize()
        ScrollBar1.Max = 400
        ScrollBar1.Min = 10
        ScrollBar1.Value = 100
        
        Label1.Caption = "10  -----Percent of Original Size---- 400"
        Label2.Caption = ScrollBar1.Value
        
        Frame1.TextBox1.Text = "Enter your text here."
        Frame1.TextBox1.MultiLine = True
        Frame1.TextBox1.WordWrap = True
        
        Frame1.Zoom = ScrollBar1.Value
    End Sub
    
    Private Sub ScrollBar1_Change()
        Frame1.Zoom = ScrollBar1.Value
        Label2.Caption = ScrollBar1.Value
    End Sub