SplitterControlExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.1.0.0)
Adds fluent markup extension methods to the SplitContainer class.
- C#
- VB.NET
public class SplitterControlExtensions
Public Class SplitterControlExtensions
Methods
BorderStyle<TSplitContainer>(splitContainer, borderStyle)
Sets the BorderStyle property of the specified SplitContainer.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container for which to set the BorderStyle property. |
| borderStyle | BorderStyle | The 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);
FixedPanel<TSplitContainer>(splitContainer, fixedPanel)
Sets the FixedPanel property of the specified SplitContainer.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container for which to set the FixedPanel property. |
| fixedPanel | FixedPanel | The 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);
IsSplitterFixed<TSplitContainer>(splitContainer, value)
Sets the IsSplitterFixed property of the specified SplitContainer.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container for which to set the IsSplitterFixed property. |
| value | Boolean | A 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);
OnOrientationChanged<TSplitContainer>(splitContainer, action)
Attaches an event handler for the OrientationChanged event of the specified SplitContainer.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, must inherit from SplitContainer and support the OrientationChanged event. | |
| splitContainer | TSplitContainer | The split container to attach the event handler to. |
| action | Action<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!");
});
OnSplitterMoved<TSplitContainer>(splitContainer, action)
Attaches an action to be executed when the splitter has been moved.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, which must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container instance to attach the event handler to. |
| action | Action<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
});
OnSplitterMoving<TSplitContainer>(splitContainer, action)
Attaches an action to be executed when the splitter is being moved.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, which must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container instance to attach the event handler to. |
| action | Action<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
});
Orientation<TSplitContainer>(splitContainer, orientation)
Sets the Orientation property of the specified SplitContainer.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container for which to set the Orientation property. |
| orientation | Orientation | The 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);
Panel1<TSplitContainer>(splitContainer, controls)
Adds an array of controls to Panel1 of the specified SplitContainer.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, which must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container to which the controls will be added to Panel1. |
| controls | Control[] | 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());
Panel1Collapsed<TSplitContainer>(splitContainer, value)
Sets the Panel1Collapsed property of the specified SplitContainer.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container for which to set the Panel1Collapsed property. |
| value | Boolean | A 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);
Panel1MinSize<TSplitContainer>(splitContainer, size)
Sets the Panel1MinSize property of the specified SplitContainer.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container for which to set the Panel1MinSize property. |
| size | Int32 | The 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);
Panel2<TSplitContainer>(splitContainer, controls)
Adds an array of controls to Panel2 of the specified SplitContainer.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, which must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container to which the controls will be added to Panel2. |
| controls | Control[] | 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());
Panel2Collapsed<TSplitContainer>(splitContainer, value)
Sets the Panel2Collapsed property of the specified SplitContainer.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container for which to set the Panel2Collapsed property. |
| value | Boolean | A 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);
Panel2MinSize<TSplitContainer>(splitContainer, size)
Sets the Panel2MinSize property of the specified SplitContainer.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container for which to set the Panel2MinSize property. |
| size | Int32 | The 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);
SplitterDistance<TSplitContainer>(splitContainer, distance)
Sets the splitter distance for the specified SplitContainer, determining the size of Panel1.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, which must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container for which to set the splitter distance. |
| distance | Int32 | The 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);
SplitterWidth<TSplitContainer>(splitContainer, width)
Sets the SplitterWidth property of the specified SplitContainer.
| Parameter | Type | Description |
|---|---|---|
| TSplitContainer | The type of the split container, must inherit from SplitContainer. | |
| splitContainer | TSplitContainer | The split container for which to set the SplitterWidth property. |
| width | Int32 | The 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);