Name

Splitter

Synopsis

This Control is automatically docked to either the Top, Bottom, Left, or Right of a control. It is then used to automatically resize the Control object docked to the same edge immediately preceding it in the Z order, as the user drags it around with the mouse.

You can set the minimum dimension for the Control you are adjusting with the MinSize property. The split bar can be further constrained by specifying MinExtra. This determines the minimum size of the remaining portion of the control (i.e., the area into which a Control with the Dock property set to DockStyle.Fill would be positioned).

The current position of the bar can be controlled with the SplitPosition property.

The split bar raises SplitterMoving and SplitterMoved events as it is dragged around and then released. You can modify the splitter position dynamically by binding to these events and changing the event data.


public class Splitter : Control : IMessageFilter {

// Public Constructors

   public Splitter();

// Public Instance Properties

   public override bool AllowDrop{set; get; }

// overrides Control

   public override AnchorStyles Anchor{set; get; }

// overrides Control

   public override Image BackgroundImage{set; get; }

// overrides Control

   public BorderStyle BorderStyle{set; get; }

   public override DockStyle Dock{set; get; }

// overrides Control

   public override Font Font{set; get; }

// overrides Control

   public override Color ForeColor{set; get; }

// overrides Control

   public ImeMode ImeMode{set; get; }

Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.