Table of Contents

Class Splitter

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Provides resizing of docked elements. You can dock some control to an edge of a container using Dock property, and then dock the splitter to the same edge. The splitter resizes the control that is previous in the docking order.

public class Splitter : HiddenBorder, IBaseObjectWithAttr, IBaseObjectWithId, INotifyPropertyChanged, IDisposableObject, IBaseObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, ILayoutItem, INotifyDataErrorInfo
Inheritance
Splitter
Implements
Derived

Examples

Here is how to declare a Splitter in UIXML:

<LayoutPanel>
  <Panel Dock="Fill" Name="fillPanel"/>
  <Splitter Dock="Top"/>
  <StdListBox Dock="Top" MinHeight="200" Name="topListBox"/>
</LayoutPanel>

Also, a Splitter can be created from code:

LayoutPanel panel = new();

StdListBox listBox1 = new()
{
    Dock = DockStyle.Fill,
    Parent = panel,
};
listBox1.Add("Fill");

Splitter splitter = new()
{
    Dock = DockStyle.Right,
    Parent = panel,
};

StdListBox listBox2 = new()
{
    Dock = DockStyle.Right,
    Parent = panel,
    MinWidth = 250,
};
listBox2.Add("Right");

panel.Parent = fillPanel;

Constructors

Splitter()

Initializes a new instance of the Splitter class.

Splitter(Control)

Initializes a new instance of the Splitter class.

Fields

DefaultDarkColors

Gets or sets default splitter background and line color for the dark color theme.

DefaultLightColors

Gets or sets default splitter background and line color for the light color scheme.

DefaultParentBackColor

Gets or sets a default value of the ParentBackColor property.

DefaultWidth

Gets or sets default splitter width.

Properties

Bounds

Gets or sets the AbstractControl bounds relative to the parent, in device-independent units.

DefaultCursor

Gets default splitter cursor.

Dock

Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent.

Horizontal

Gets whether the splitter is horizontal.

IsBackgroundPainted

Gets or sets a value indicating whether the background is painted. Default is true.

IsForegroundPainted

Gets or sets a value indicating whether the foreground is painted. Default is true.

MinExtra

Gets or sets minimum size (in dips) of the remaining area of the container. This area is located in the center of the container that is not occupied by edge docked controls. This is the area that would be used for any Fill docked control.

MinSize

Gets or sets the minimum size (in dips) of the target of the splitter. The target of a splitter is the control that is previous in the docking order

NormalColors

Gets or sets splitter background and line color when control state is Normal.

ResolveSplitterColorsOverride

Gets or sets a delegate that resolves the splitter colors. Use this property to override the default splitter colors resolve method.

SizeDelta

Gets or sets number of dips on which splitter needs to be moved in order to update attached control size.

SplitPosition

Gets or sets the position of the splitter.

TargetMode

Gets or sets the mode that determines how the splitter targets its associated elements.

Methods

ApplySplitPosition()

Sets the split position to be the current split size.

CalcSplitBounds()

Gets the bounding criteria for the splitter.

CalcSplitLine(float, float)

Calculates the bounding rect of the split line. minWeight refers to the minimum height or width of the split line.

CalcSplitSize()

Calculates the current size of the splitter-target.

DefaultPaint(PaintEventArgs)

Default painting method of the UserControl and its descendants.

DrawSplitBar(DrawSplitBarKind)

Draws the splitter bar at the current location. Will automatically cleanup anyplace the splitter was drawn previously.

DrawSplitHelper(float)

Draws the splitter line at the requested location.

DrawSplitterBackground(PaintEventArgs, Color?)

Draws the background of the splitter.

DrawSplitterBorder(PaintEventArgs)

Draws the border of the splitter control.

DrawSplitterForeground(PaintEventArgs, Color?)

Draws the foreground of the splitter.

FindTarget()

Finds the target of the splitter. For example, if the splitter is docked right, the target is the control that is just to the right of the splitter.

GetDefaultWidth()

Gets the default width of the splitter.

GetSplitSize(float, float)

Calculates the split size based on the mouse position (x, y).

OnKeyDown(KeyEventArgs)

Called when the KeyDown event is raised.

OnMouseCaptureLost(EventArgs)

Called when the control loses mouse capture.

OnMouseDown(MouseEventArgs)

Called when the mouse button was pressed.

OnMouseMove(MouseEventArgs)

Called when the mouse is moved.

OnMouseUp(MouseEventArgs)

Called when the mouse button was released.

OnSplitterMoved(SplitterEventArgs)

Raises the SplitterMoved event. This event occurs when the user finishes moving the splitter.

OnSplitterMoving(SplitterEventArgs)

Raises the SplitterMoving event. This event occurs while the splitter is being moved by the user.

ResolveSplitterColors(out Color?, out Color?)

Resolves the splitter colors based on the current theme and background.

SplitBegin(float, float)

Begins the splitter moving.

SplitEnd(bool)

Finishes the split movement.

SplitMove(float, float)

Moves the splitter line to the splitSize for the mouse position (x, y).

ToString()

Returns a string representation for this control.

Events

SplitterMoved

Occurs when the splitter control is moved.

SplitterMoving

Occurs when the splitter control is in the process of moving.