McBasic™Get McBasic™ ↗
Build 881
Containers · Container
SplitContainer component icon

SplitContainer

Separate navigation and detail with a movable splitter.

41 properties12 events0 methodsDefault: SplitterMoved

Use it in a Form#

The splitter belongs to the container, not to either pane’s content. Use SplitterMoved to observe a completed layout change. Check the minimum practical size of each pane so moving the divider does not make a task impossible.

Add SplitContainer to its intended parent and name it splitMain for this example:

PropertyExample value
Orientation"Horizontal"
Ratio0.42
SplitterWidth6
FirstPaneMinSize120
SecondPaneMinSize160
IsSplitterFixedFalse
FixedPane"None"
FirstPaneCollapsedFalse
SecondPaneCollapsedFalse

A complete handler from Forms/frmMain.bas. The linked lesson includes its surrounding controls, declarations and helpers.

Forms/frmMain.bas
Private Sub splitMain_SplitterMoved()
    staStatus.Text = "Splitter moved — ratio " & CStr(splitMain.Ratio) & ", position " & CStr(splitMain.SplitterPosition)
End Sub

Properties#

Contract defaults are shown below. Where a new control has a different Designer starting value, that value is listed separately.

Left

DoubleDefault: 0

Horizontal position in device-independent points, relative to the parent container.

Range: -100000 to 100000.

Top

DoubleDefault: 0

Vertical position in device-independent points, relative to the parent container.

Range: -100000 to 100000.

Width

DoubleDefault: 360

SplitContainer width in device-independent points.

Range: 0 to 100000.

Height

DoubleDefault: 220

SplitContainer height in device-independent points.

Range: 0 to 100000.

MinWidth

DoubleDefault: 0

Minimum control width in device-independent points; 0 lets the parent layout choose.

Range: 0 to 100000.

MinHeight

DoubleDefault: 0

Minimum control height in device-independent points; 0 lets the parent layout choose.

Range: 0 to 100000.

MaxWidth

DoubleDefault: 100000

Maximum control width in device-independent points.

Range: 0 to 100000.

MaxHeight

DoubleDefault: 100000

Maximum control height in device-independent points.

Range: 0 to 100000.

TabIndex

LongDefault: 0

Keyboard navigation order within the parent container; lower values come first.

Range: 0 to 100000.

ZIndex

LongDefault: 0

Stacking order among sibling controls; larger values appear in front. Equal values preserve document order.

Range: -100000 to 100000.

Anchor

StringDefault: "Left,Top"Not in InspectorNot serialized

Edges kept at their authored distance when the parent resizes. Use a comma-separated combination of Left, Top, Right and Bottom; Dock overrides the effective anchor without deleting it.

Dock

StringDefault: "None"

Automatic placement within the parent: None, Left, Top, Right, Bottom or Fill. Dock overrides effective Anchor layout without deleting the stored anchors.

Margin

StringDefault: "0"

External spacing as one non-negative DIP value or Left,Top,Right,Bottom.

Visible

BooleanDefault: True

Whether the container is shown in the running application.

BackColor

StringDefault: ""

Container background color as #RRGGBB. Empty uses the current theme background.

Padding

StringDefault: "0"

Inner spacing as one non-negative DIP value or Left,Top,Right,Bottom; child coordinates remain relative to the padded content area.

AccessibleName

StringDefault: ""

Name announced by assistive technology. Empty uses the stable control Name.

Cursor

StringDefault: "Default"

Pointer shown over the control: Default, Arrow, Hand, IBeam, Cross, Wait, Help, SizeAll, SizeNS, SizeWE, SizeNWSE, SizeNESW or NotAllowed.

Opacity

DoubleDefault: 1

Visual opacity from 0 (transparent) to 1 (opaque).

Range: 0 to 1.

DesignLocked

BooleanDefault: FalseDesigner only

Prevents movement and resizing in the Designer without changing runtime interaction.

AccessibleDescription

StringDefault: ""

Additional help text announced by assistive technology.

AccessibleRole

StringDefault: "Auto"

Accessibility role override. Auto preserves the native semantic role; explicit values use the corresponding platform automation role.

AutomationId

StringDefault: ""

Stable automation identifier; empty uses the component Name.

ToolTipText

StringDefault: ""

Help text shown when the pointer rests over the running control; empty disables the tooltip.

Tag

StringDefault: ""

Application-defined text associated with this control; McBasic™ does not interpret it.

Enabled

BooleanDefault: True

Whether children in the container accept user interaction.

HitTestVisible

BooleanDefault: True

Whether the running control participates in pointer hit testing. The control remains selectable in the Designer.

AllowDrop

BooleanDefault: False

Whether this running control accepts application drag-and-drop operations; Designer movement is separate.

DragMode

LongDefault: 0

VB control drag: 0 Manual (code starts a drag with the Drag method) or 1 Automatic (a left-button press starts a drag, and the control raises no Click, MouseDown or MouseUp for that press).

Range: 0 to 1.

DragIcon

StringDefault: ""

Case-insensitive name of a declared project image resource shown under the pointer while this control is dragged; empty shows a grey outline of the control.

Orientation

StringDefault: "Horizontal"

Pane direction: Horizontal places panes left and right; Vertical places panes above and below.

Ratio

DoubleDefault: 0.5

Initial first-pane share of the available space; must remain between 0.05 and 0.95.

Range: 0.05 to 0.95.

SplitterWidth

DoubleDefault: 4

Interactive splitter thickness in device-independent points.

Range: 1 to 64.

FirstPaneMinSize

DoubleDefault: 0

Minimum width or height of the first pane along the split axis.

Range: 0 to 100000.

SecondPaneMinSize

DoubleDefault: 0

Minimum width or height of the second pane along the split axis.

Range: 0 to 100000.

IsSplitterFixed

BooleanDefault: False

When true, keeps the authored split ratio and disables user dragging of the splitter.

FixedPane

StringDefault: "None"

Pane whose absolute size remains stable when the SplitContainer is resized: None, First or Second.

SplitterPosition

DoubleDefault: 0Read only in BASICNot in InspectorNot serialized

Current leading-edge splitter position in device-independent points. Set Ratio to move the splitter programmatically.

Range: 0 to 100000.

FirstPaneCollapsed

BooleanDefault: False

Collapses the first pane and gives the second pane all available space; both panes cannot be collapsed together.

SecondPaneCollapsed

BooleanDefault: False

Collapses the second pane and gives the first pane all available space; both panes cannot be collapsed together.

Index

LongDefault: -1Read only in BASICDesigner Index row

Position of this control in its control array, 0 to 32767. Several controls share one name only when every one of them has an Index. Absent from the layout, and -1 in code, when the control is not in an array.

Designer values: 0 to 32767. Clear the dedicated Index row for a non-array control; BASIC then reads -1.

Events and parameters#

Replace control with the object’s Name when creating a handler. ByRef arguments may be changed by your handler; ByVal arguments report an input value.

SplitterMoved

Occurs after the user finishes moving the splitter.

Signature — see the complete lesson for an implementation
Private Sub control_SplitterMoved()

No parameters.

DragEnter

Occurs when runtime drag data enters this control; set Effect to Copy, Move, Link or None.

Signature — see the complete lesson for an implementation
Private Sub control_DragEnter(ByVal Data As DragData, ByRef Effect As DragEffect, ByVal X As Double, ByVal Y As Double)
ParameterTypeDirection
DataDragDataByVal
EffectDragEffectByRef
XDoubleByVal
YDoubleByVal

DragOver

Occurs while runtime drag data moves over this control; Effect may be updated for the current position.

Signature — see the complete lesson for an implementation
Private Sub control_DragOver(ByVal Data As DragData, ByRef Effect As DragEffect, ByVal X As Double, ByVal Y As Double)
ParameterTypeDirection
DataDragDataByVal
EffectDragEffectByRef
XDoubleByVal
YDoubleByVal

DragOver

Occurs while a control dragged inside the app (DragMode or the Drag method) moves over this control: State is 0 when it enters, 2 while it moves over and 1 when it leaves; Source is the dragged control and X, Y are local DIP coordinates.

Signature — see the complete lesson for an implementation
Private Sub control_DragOver(ByVal Source As Control, ByVal X As Single, ByVal Y As Single, ByVal State As Integer)
ParameterTypeDirection
SourceControlByVal
XSingleByVal
YSingleByVal
StateIntegerByVal

DragLeave

Occurs when runtime drag data leaves this control without a drop.

Signature — see the complete lesson for an implementation
Private Sub control_DragLeave()

No parameters.

Drop

Occurs when runtime drag data is dropped on this control with a stable McBasic™ effect and local DIP coordinates.

Signature — see the complete lesson for an implementation
Private Sub control_Drop(ByVal Data As DragData, ByVal Effect As DragEffect, ByVal X As Double, ByVal Y As Double)
ParameterTypeDirection
DataDragDataByVal
EffectDragEffectByVal
XDoubleByVal
YDoubleByVal

DragDrop

Occurs when a control dragged inside the app (DragMode or the Drag method) is released over this control; Source is the dragged control and X, Y are local DIP coordinates.

Signature — see the complete lesson for an implementation
Private Sub control_DragDrop(ByVal Source As Control, ByVal X As Single, ByVal Y As Single)
ParameterTypeDirection
SourceControlByVal
XSingleByVal
YSingleByVal

MouseDown

Occurs when a pointing-device button is pressed over this control; Button is stable McBasic™ identity and X/Y are control-local DIP coordinates.

Signature — see the complete lesson for an implementation
Private Sub control_MouseDown(ByVal Button As MouseButton, ByVal Shift As KeyModifiers, ByVal X As Double, ByVal Y As Double)
ParameterTypeDirection
ButtonMouseButtonByVal
ShiftKeyModifiersByVal
XDoubleByVal
YDoubleByVal

MouseUp

Occurs when a pointing-device button is released for this control; Button is stable McBasic™ identity and X/Y are control-local DIP coordinates.

Signature — see the complete lesson for an implementation
Private Sub control_MouseUp(ByVal Button As MouseButton, ByVal Shift As KeyModifiers, ByVal X As Double, ByVal Y As Double)
ParameterTypeDirection
ButtonMouseButtonByVal
ShiftKeyModifiersByVal
XDoubleByVal
YDoubleByVal

MouseMove

Occurs when the pointer moves over the logical McBasic™ control; Button contains the currently held buttons and X/Y are local DIP coordinates.

Signature — see the complete lesson for an implementation
Private Sub control_MouseMove(ByVal Button As MouseButtons, ByVal Shift As KeyModifiers, ByVal X As Double, ByVal Y As Double)
ParameterTypeDirection
ButtonMouseButtonsByVal
ShiftKeyModifiersByVal
XDoubleByVal
YDoubleByVal

MouseEnter

Occurs once when the pointer enters the effective bounds of the logical McBasic™ control.

Signature — see the complete lesson for an implementation
Private Sub control_MouseEnter()

No parameters.

MouseLeave

Occurs once when the pointer leaves the effective bounds of the logical McBasic™ control.

Signature — see the complete lesson for an implementation
Private Sub control_MouseLeave()

No parameters.

DoubleClick

Occurs when native system timing recognizes a primary-button double activation on the same logical McBasic™ control.

Signature — see the complete lesson for an implementation
Private Sub control_DoubleClick()

No parameters.

Methods#

No methods are declared in this component’s built-in metadata. Use its documented properties and events; do not infer APIs from a similarly named control in another framework.

Source baseline 20f4bfed6b · Build manifest