FrameW Control
Provides a container frame control that supports visual styles, transparent background, and image display. Can serve as a container for other controls.
Enumerations
No proprietary public enumerations. Uses the following common enumerations: CCAppearanceConstants, CCLeftRightAlignmentConstants, CCMousePointerConstants, CCRightToLeftModeConstants, OLEDropModeConstants.
Properties
Name
Property Get Name() As StringReturns the name of the control.
Tag
Property Get/Let Tag() As StringReturns/sets the tag value of the control.
Parent
Property Get Parent() As ObjectReturns the parent object of the control.
Container
Property Get/Set Container() As ObjectReturns/sets the container of the control.
Left
Property Get/Let Left() As SingleReturns/sets the position of the left edge of the control.
Top
Property Get/Let Top() As SingleReturns/sets the position of the top edge of the control.
Width
Property Get/Let Width() As SingleReturns/sets the width of the control.
Height
Property Get/Let Height() As SingleReturns/sets the height of the control.
Visible
Property Get/Let Visible() As BooleanReturns/sets whether the control is visible.
ToolTipText
Property Get/Let ToolTipText() As StringReturns/sets the tooltip text of the control.
WhatsThisHelpID
Property Get/Let WhatsThisHelpID() As LongReturns/sets the "What's This" Help ID of the control.
DragIcon
Property Get/Let/Set DragIcon() As IPictureDispReturns/sets the icon displayed during drag operations.
DragMode
Property Get/Let DragMode() As IntegerReturns/sets the drag mode (manual or automatic).
hWnd
Property Get hWnd() As LongPtrReturns the window handle of the control.
Font
Property Get/Let/Set Font() As StdFontReturns/sets the font used by the control.
VisualStyles
Property Get/Let VisualStyles() As BooleanReturns/sets whether visual styles are enabled.
Appearance
Property Get/Let Appearance() As CCAppearanceConstantsReturns/sets the visual appearance of the control. See Common Enumerations.
BackColor
Property Get/Let BackColor() As OLE_COLORReturns/sets the background color of the control.
ForeColor
Property Get/Let ForeColor() As OLE_COLORReturns/sets the foreground color of the control (caption text color).
Enabled
Property Get/Let Enabled() As BooleanReturns/sets whether the control is enabled.
OLEDropMode
Property Get/Let OLEDropMode() As OLEDropModeConstantsReturns/sets the OLE drop mode. See Common Enumerations.
MousePointer
Property Get/Let MousePointer() As CCMousePointerConstantsReturns/sets the mouse pointer type. See Common Enumerations.
MouseIcon
Not available. The frame control does not support custom mouse icons.
MouseTrack
Property Get/Let MouseTrack() As BooleanReturns/sets whether mouse enter/leave tracking is enabled.
RightToLeft
Property Get/Let RightToLeft() As BooleanReturns/sets whether right-to-left layout is enabled.
RightToLeftMode
Property Get/Let RightToLeftMode() As CCRightToLeftModeConstantsReturns/sets the right-to-left mode. See Common Enumerations.
BorderStyle
Property Get/Let BorderStyle() As IntegerReturns/sets the border style of the control. Values: 0 (vbBSNone) no border, 1 (vbFixedSingle) fixed single border.
Caption
Property Get/Let Caption() As StringReturns/sets the frame caption text.
UseMnemonic
Property Get/Let UseMnemonic() As BooleanReturns/sets whether the & character in the caption acts as an access key.
Alignment
Property Get/Let Alignment() As VBRUN.AlignmentConstantsReturns/sets the alignment of the caption.
Transparent
Property Get/Let Transparent() As BooleanReturns/sets whether the control is transparent.
Picture
Property Get/Let/Set Picture() As IPictureDispReturns/sets the image displayed in the frame.
PictureAlignment
Property Get/Let PictureAlignment() As CCLeftRightAlignmentConstantsReturns/sets the alignment of the image. See Common Enumerations.
ContainedControls
Property Get ContainedControls() As VBRUN.ContainedControlsReturns the collection of controls contained by the frame. Read-only.
Methods
OLEDrag
Public Sub OLEDrag()Initiates an OLE drag operation.
Drag
Public Sub Drag(Optional ByRef Action As Variant)Starts, ends, or cancels a drag operation.
ZOrder
Public Sub ZOrder(Optional ByRef Position As Variant)Sets the Z-order position of the control within its layer.
Refresh
Public Sub Refresh()Forces a complete repaint of the control.
Events
Click
Public Event Click()Occurs when the control is clicked.
DblClick
Public Event DblClick()Occurs when the control is double-clicked.
Resize
Public Event Resize()Occurs when the control is resized.
MouseDown
Public Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Occurs when a mouse button is pressed.
MouseMove
Public Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)Occurs when the mouse is moved.
MouseUp
Public Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Occurs when a mouse button is released.
MouseEnter
Public Event MouseEnter()Occurs when the mouse enters the control.
MouseLeave
Public Event MouseLeave()Occurs when the mouse leaves the control.
OLECompleteDrag
Public Event OLECompleteDrag(Effect As Long)Occurs on the source control after an OLE drag-and-drop operation is completed or cancelled.
OLEDragDrop
Public Event OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)Occurs when data is dropped onto the control via an OLE drag-and-drop operation.
OLEDragOver
Public Event OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)Occurs when the mouse moves over the control during an OLE drag-and-drop operation.
OLEGiveFeedback
Public Event OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)Occurs on the source control when the mouse cursor needs to be changed during an OLE drag-and-drop operation.
OLESetData
Public Event OLESetData(Data As DataObject, DataFormat As Integer)Occurs on the source control when the drop target requests data.
OLEStartDrag
Public Event OLEStartDrag(Data As DataObject, AllowedEffects As Long)Occurs when an OLE drag-and-drop operation is started.
Code Examples
Basic Usage
Private Sub Form_Load()
With FrameW1
.Caption = "Option Settings"
.BorderStyle = vbFixedSingle
.UseMnemonic = True
.Alignment = vbLeftJustify
.VisualStyles = True
End With
End Sub
Private Sub FrameW1_Resize()
Debug.Print "Frame size: " & FrameW1.Width & " x " & FrameW1.Height
End Sub