Skip to main content
Version: 4.1

SplitterControlExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.1.0.0)

Adds fluent markup extension methods to the SplitContainer class.

public class SplitterControlExtensions

Methods

Static member BorderStyle<TSplitContainer>(splitContainer, borderStyle)

Sets the BorderStyle property of the specified SplitContainer.

ParameterTypeDescription
TSplitContainerThe type of the split container, must inherit from SplitContainer.
splitContainerTSplitContainerThe split container for which to set the BorderStyle property.
borderStyleBorderStyleThe BorderStyle to set for the split container.

Returns: TSplitContainer. The modified split container with the updated BorderStyle property.

This method allows you to set the border style for the split container.


mySplitContainer.BorderStyle(BorderStyle.Fixed3D);

Static member FixedPanel<TSplitContainer>(splitContainer, fixedPanel)

Sets the FixedPanel property of the specified SplitContainer.

ParameterTypeDescription
TSplitContainerThe type of the split container, must inherit from SplitContainer.
splitContainerTSplitContainerThe split container for which to set the FixedPanel property.
fixedPanelFixedPanelThe FixedPanel to set for the split container.

Returns: TSplitContainer. The modified split container with the updated FixedPanel property.

This method allows you to specify which panel remains the same size when the split container is resized.


mySplitContainer.FixedPanel(FixedPanel.Panel1);

Static member IsSplitterFixed<TSplitContainer>(splitContainer, value)

Sets the IsSplitterFixed property of the specified SplitContainer.

ParameterTypeDescription
TSplitContainerThe type of the split container, must inherit from SplitContainer.
splitContainerTSplitContainerThe split container for which to set the IsSplitterFixed property.
valueBooleanA boolean indicating whether the splitter is fixed.

Returns: TSplitContainer. The modified split container with the updated IsSplitterFixed property.

This method allows you to specify whether the splitter can be moved by the user.


mySplitContainer.IsSplitterFixed(true);

Static member OnOrientationChanged<TSplitContainer>(splitContainer, action)

Attaches an event handler for the OrientationChanged event of the specified SplitContainer.

ParameterTypeDescription
TSplitContainerThe type of the split container, must inherit from SplitContainer and support the OrientationChanged event.
splitContainerTSplitContainerThe split container to attach the event handler to.
actionAction<TSplitContainer>An action to execute when the orientation of the split container changes.

Returns: TSplitContainer. The modified split container with the attached OrientationChanged event handler.

This method allows you to execute a custom action whenever the orientation of the split container changes.


mySplitContainer.OnOrientationChanged(sc =>
{
AlertBox.Show("Orientation changed!");
});

Static member OnSplitterMoved<TSplitContainer>(splitContainer, action)

Attaches an action to be executed when the splitter has been moved.

ParameterTypeDescription
TSplitContainerThe type of the split container, which must inherit from SplitContainer.
splitContainerTSplitContainerThe split container instance to attach the event handler to.
actionAction<TSplitContainer, SplitterEventArgs>The action to execute when the splitter is moved. It receives the split container and the event arguments as parameters.

Returns: TSplitContainer. The original split container instance with the event handler attached.

This method allows you to easily attach a custom action to the SplitterMoved event.


var mySplitContainer = new SplitContainer();
mySplitContainer.OnSplitterMoved((container, args) =>
{
// Custom logic when the splitter is moved
});

Static member OnSplitterMoving<TSplitContainer>(splitContainer, action)

Attaches an action to be executed when the splitter is being moved.

ParameterTypeDescription
TSplitContainerThe type of the split container, which must inherit from SplitContainer.
splitContainerTSplitContainerThe split container instance to attach the event handler to.
actionAction<TSplitContainer, SplitterCancelEventArgs>The action to execute when the splitter is moving. It receives the split container and the event arguments as parameters.

Returns: TSplitContainer. The original split container instance with the event handler attached.

This method allows you to easily attach a custom action to the SplitterMoving event.


var mySplitContainer = new SplitContainer();
mySplitContainer.OnSplitterMoving((container, args) =>
{
// Custom logic when the splitter is moving
});

Static member Orientation<TSplitContainer>(splitContainer, orientation)

Sets the Orientation property of the specified SplitContainer.

ParameterTypeDescription
TSplitContainerThe type of the split container, must inherit from SplitContainer.
splitContainerTSplitContainerThe split container for which to set the Orientation property.
orientationOrientationThe Orientation to set for the split container.

Returns: TSplitContainer. The modified split container with the updated Orientation property.

This method allows you to set the orientation (horizontal or vertical) of the split container.


mySplitContainer.Orientation(Orientation.Vertical);

Static member Panel1<TSplitContainer>(splitContainer, controls)

Adds an array of controls to Panel1 of the specified SplitContainer.

ParameterTypeDescription
TSplitContainerThe type of the split container, which must inherit from SplitContainer.
splitContainerTSplitContainerThe split container to which the controls will be added to Panel1.
controlsControl[]An array of controls to be added to Panel1.

Returns: TSplitContainer. The split container with the updated Panel1 controls.

This method allows you to add multiple controls to the first panel of a split container.


mySplitContainer.Panel1(new Button(), new TextBox());

Static member Panel1Collapsed<TSplitContainer>(splitContainer, value)

Sets the Panel1Collapsed property of the specified SplitContainer.

ParameterTypeDescription
TSplitContainerThe type of the split container, must inherit from SplitContainer.
splitContainerTSplitContainerThe split container for which to set the Panel1Collapsed property.
valueBooleanA boolean indicating whether Panel1 is collapsed.

Returns: TSplitContainer. The modified split container with the updated Panel1Collapsed property.

This method allows you to collapse or expand Panel1 of the split container.


mySplitContainer.Panel1Collapsed(true);

Static member Panel1MinSize<TSplitContainer>(splitContainer, size)

Sets the Panel1MinSize property of the specified SplitContainer.

ParameterTypeDescription
TSplitContainerThe type of the split container, must inherit from SplitContainer.
splitContainerTSplitContainerThe split container for which to set the Panel1MinSize property.
sizeInt32The minimum size of Panel1.

Returns: TSplitContainer. The modified split container with the updated Panel1MinSize property.

This method allows you to specify the minimum size of Panel1 in the split container.


mySplitContainer.Panel1MinSize(100);

Static member Panel2<TSplitContainer>(splitContainer, controls)

Adds an array of controls to Panel2 of the specified SplitContainer.

ParameterTypeDescription
TSplitContainerThe type of the split container, which must inherit from SplitContainer.
splitContainerTSplitContainerThe split container to which the controls will be added to Panel2.
controlsControl[]An array of controls to be added to Panel2.

Returns: TSplitContainer. The split container with the updated Panel2 controls.

This method allows you to add multiple controls to the second panel of a split container.


mySplitContainer.Panel2(new Label(), new ListBox());

Static member Panel2Collapsed<TSplitContainer>(splitContainer, value)

Sets the Panel2Collapsed property of the specified SplitContainer.

ParameterTypeDescription
TSplitContainerThe type of the split container, must inherit from SplitContainer.
splitContainerTSplitContainerThe split container for which to set the Panel2Collapsed property.
valueBooleanA boolean indicating whether Panel2 is collapsed.

Returns: TSplitContainer. The modified split container with the updated Panel2Collapsed property.

This method allows you to collapse or expand Panel2 of the split container.


mySplitContainer.Panel2Collapsed(true);

Static member Panel2MinSize<TSplitContainer>(splitContainer, size)

Sets the Panel2MinSize property of the specified SplitContainer.

ParameterTypeDescription
TSplitContainerThe type of the split container, must inherit from SplitContainer.
splitContainerTSplitContainerThe split container for which to set the Panel2MinSize property.
sizeInt32The minimum size of Panel2.

Returns: TSplitContainer. The modified split container with the updated Panel2MinSize property.

This method allows you to specify the minimum size of Panel2 in the split container.


mySplitContainer.Panel2MinSize(100);

Static member SplitterDistance<TSplitContainer>(splitContainer, distance)

Sets the splitter distance for the specified SplitContainer, determining the size of Panel1.

ParameterTypeDescription
TSplitContainerThe type of the split container, which must inherit from SplitContainer.
splitContainerTSplitContainerThe split container for which to set the splitter distance.
distanceInt32The distance, in pixels, from the left or top edge of the split container to the splitter.

Returns: TSplitContainer. The split container with the updated splitter distance.

This method allows you to specify the size of the first panel in a split container by setting the distance of the splitter.


mySplitContainer.SplitterDistance(150);

Static member SplitterWidth<TSplitContainer>(splitContainer, width)

Sets the SplitterWidth property of the specified SplitContainer.

ParameterTypeDescription
TSplitContainerThe type of the split container, must inherit from SplitContainer.
splitContainerTSplitContainerThe split container for which to set the SplitterWidth property.
widthInt32The width of the splitter.

Returns: TSplitContainer. The modified split container with the updated SplitterWidth property.

This method allows you to specify the width of the splitter in the split container.


mySplitContainer.SplitterWidth(10);