Nevron Open Vision Documentation
Splitter

The splitter is a widget that splits its content area into resizable panes, which can be interactively resized with help of a thumb. Nevron Open Vision provides two splitter widget, which both inherit the class NSplitterBase:

Properties

The splitter provides the following properties:

The multi-splitter provides the following properties:

Splitter thumb provides the following properties:

Splitter Code Example

The following example demonstrates how to create a splitter and set the minimum sizes of its planes. The planes have borders and a solid background, so that you can easily distinguish them:

Splitter Example
Copy Code
NSplitter splitter = new NSplitter();
 
splitter.Pane1.Content = new NLabel("Pane1 Min Width/Height = 100");
splitter.Pane1.Background = new NBackground(NColor.LightGreen);
splitter.Pane1.Border = NBorder.CreateFilledBorder(NColor.Black);
splitter.Pane1.BorderThickness = new NMargins(1);
splitter.Pane1.MinWidth = 100;
splitter.Pane1.MinHeight = 100;
 
splitter.Pane2.Content = new NLabel("Pane2 Min Width/Height = 200");
splitter.Pane2.Background = new NBackground(NColor.LightBlue);
splitter.Pane2.Border = NBorder.CreateFilledBorder(NColor.Black);
splitter.Pane2.BorderThickness = new NMargins(1);
splitter.Pane2.MinWidth = 200;
splitter.Pane2.MinHeight = 200;
 
splitter.ResizeStep = 20;

The result of this piece of code will be:

Because of the set minimum size constraints, the splitter will not allow you to move its thumb so that there are less than 100 dips on left side of the splitter or less than 200 dips on its right side.

Multi-splitter Code Example

The following example demonstrates how to create and configure  a multi-splitter:

Multi-splitter Example
Copy Code
NMultiSplitter multiSplitter = new NMultiSplitter();

NSplitterPane pane1 = new NSplitterPane();
pane1.Padding = new NMargins(NDesign.HorizontalSpacing, NDesign.VerticalSpacing);
pane1.BackgroundFill = new NColorFill(NColor.LightGreen);
pane1.Border = NBorder.CreateFilledBorder(NColor.Black);
pane1.BorderThickness = new NMargins(1);
pane1.Content = new NLabel("Pane 1");
multiSplitter.Widgets.Add(pane1);

NSplitterThumb thumb1 = new NSplitterThumb();
thumb1.CollapseMode = ENSplitterCollapseMode.BothPanes;
multiSplitter.Widgets.Add(thumb1);

NSplitterPane pane2 = new NSplitterPane();
pane2.Padding = new NMargins(NDesign.HorizontalSpacing, NDesign.VerticalSpacing);
pane2.BackgroundFill = new NColorFill(NColor.LightBlue);
pane2.Border = NBorder.CreateFilledBorder(NColor.Black);
pane2.BorderThickness = new NMargins(1);
pane2.Content = new NLabel("Pane 2");
multiSplitter.Widgets.Add(pane2);

NSplitterThumb thumb2 = new NSplitterThumb();
thumb2.CollapseMode = ENSplitterCollapseMode.BothPanes;
multiSplitter.Widgets.Add(thumb2);

NSplitterPane pane3 = new NSplitterPane();
pane3.Padding = new NMargins(NDesign.HorizontalSpacing, NDesign.VerticalSpacing);
pane3.BackgroundFill = new NColorFill(NColor.LightYellow);
pane3.Border = NBorder.CreateFilledBorder(NColor.Black);
pane3.BorderThickness = new NMargins(1);
pane3.Content = new NLabel("Pane 3");
multiSplitter.Widgets.Add(pane3);

The result of this piece of code will be:

Send Feedback