# SplitterControlExtensions

Namespace: **Wisej.Web.Markup**

Assembly: **Wisej.Framework** (4.0.0.0)

Adds [fluent markup](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/markup/markup) extension methods to the [SplitContainer](/api/wisej.web/containers/splitcontainer.md) class.

{% tabs %}
{% tab title="C#" %}

```csharp
public class SplitterControlExtensions
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class SplitterControlExtensions
```

{% endtab %}
{% endtabs %}

## Methods

### ![](/files/lIX317sDtMTZJBi9oSIx) BorderStyle\<TSplitContainer>(splitContainer, borderStyle)

Sets the BorderStyle property of the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md).

| Parameter           | Type                                                                                              | Description                                                                                                       |
| ------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md). |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container for which to set the BorderStyle property.                                                    |
| **borderStyle**     | [BorderStyle](/api/wisej.web/enumerations/wisej.web.borderstyle.md)                               | The [BorderStyle](#borderstyle``1) to set for the split container.                                                |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). The modified split container with the updated BorderStyle property.

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

```csharp

mySplitContainer.BorderStyle(BorderStyle.Fixed3D);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) FixedPanel\<TSplitContainer>(splitContainer, fixedPanel)

Sets the FixedPanel property of the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md).

| Parameter           | Type                                                                                              | Description                                                                                                       |
| ------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md). |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container for which to set the FixedPanel property.                                                     |
| **fixedPanel**      | [FixedPanel](/api/wisej.web/containers/splitcontainer/wisej.web.fixedpanel.md)                    | The [FixedPanel](#fixedpanel``1) to set for the split container.                                                  |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). 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.

```csharp

mySplitContainer.FixedPanel(FixedPanel.Panel1);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) IsSplitterFixed\<TSplitContainer>(splitContainer, value)

Sets the IsSplitterFixed property of the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md).

| Parameter           | Type                                                                                              | Description                                                                                                       |
| ------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md). |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container for which to set the IsSplitterFixed property.                                                |
| **value**           | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                   | A boolean indicating whether the splitter is fixed.                                                               |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). The modified split container with the updated IsSplitterFixed property.

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

```csharp

mySplitContainer.IsSplitterFixed(true);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) OnOrientationChanged\<TSplitContainer>(splitContainer, action)

Attaches an event handler for the OrientationChanged event of the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md).

| Parameter           | Type                                                                                              | Description                                                                                                                                                |
| ------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md) and support the OrientationChanged event. |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container to attach the event handler to.                                                                                                        |
| **action**          | [Action\<TSplitContainer>](https://docs.microsoft.com/dotnet/api/system.action-1)                 | An action to execute when the orientation of the split container changes.                                                                                  |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). 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.

```csharp

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

```

### ![](/files/lIX317sDtMTZJBi9oSIx) 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](/api/wisej.web/containers/splitcontainer.md).  |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md)    | The split container instance to attach the event handler to.                                                             |
| **action**          | [Action\<TSplitContainer, SplitterEventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | The action to execute when the splitter is moved. It receives the split container and the event arguments as parameters. |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). The original split container instance with the event handler attached.

This method allows you to easily attach a custom action to the [SplitterMoved](/api/wisej.web/containers/splitcontainer.md#splittermoved) event.

```csharp

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

```

### ![](/files/lIX317sDtMTZJBi9oSIx) 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](/api/wisej.web/containers/splitcontainer.md).   |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md)          | The split container instance to attach the event handler to.                                                              |
| **action**          | [Action\<TSplitContainer, SplitterCancelEventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | The action to execute when the splitter is moving. It receives the split container and the event arguments as parameters. |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). The original split container instance with the event handler attached.

This method allows you to easily attach a custom action to the [SplitterMoving](/api/wisej.web/containers/splitcontainer.md#splittermoving) event.

```csharp

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

```

### ![](/files/lIX317sDtMTZJBi9oSIx) Orientation\<TSplitContainer>(splitContainer, orientation)

Sets the Orientation property of the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md).

| Parameter           | Type                                                                                              | Description                                                                                                       |
| ------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md). |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container for which to set the Orientation property.                                                    |
| **orientation**     | [Orientation](/api/wisej.web/enumerations/wisej.web.orientation.md)                               | The [Orientation](#orientation``1) to set for the split container.                                                |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). The modified split container with the updated Orientation property.

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

```csharp

mySplitContainer.Orientation(Orientation.Vertical);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) Panel1\<TSplitContainer>(splitContainer, controls)

Adds an array of controls to Panel1 of the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md).

| Parameter           | Type                                                                                              | Description                                                                                                             |
| ------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, which must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md). |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container to which the controls will be added to Panel1.                                                      |
| **controls**        | [Control\[\]](/api/wisej.web/general/control.md)                                                  | An array of controls to be added to Panel1.                                                                             |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). The split container with the updated Panel1 controls.

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

```csharp

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

```

### ![](/files/lIX317sDtMTZJBi9oSIx) Panel1Collapsed\<TSplitContainer>(splitContainer, value)

Sets the Panel1Collapsed property of the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md).

| Parameter           | Type                                                                                              | Description                                                                                                       |
| ------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md). |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container for which to set the Panel1Collapsed property.                                                |
| **value**           | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                   | A boolean indicating whether Panel1 is collapsed.                                                                 |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). The modified split container with the updated Panel1Collapsed property.

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

```csharp

mySplitContainer.Panel1Collapsed(true);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) Panel1MinSize\<TSplitContainer>(splitContainer, size)

Sets the Panel1MinSize property of the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md).

| Parameter           | Type                                                                                              | Description                                                                                                       |
| ------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md). |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container for which to set the Panel1MinSize property.                                                  |
| **size**            | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                       | The minimum size of Panel1.                                                                                       |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). The modified split container with the updated Panel1MinSize property.

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

```csharp

mySplitContainer.Panel1MinSize(100);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) Panel2\<TSplitContainer>(splitContainer, controls)

Adds an array of controls to Panel2 of the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md).

| Parameter           | Type                                                                                              | Description                                                                                                             |
| ------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, which must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md). |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container to which the controls will be added to Panel2.                                                      |
| **controls**        | [Control\[\]](/api/wisej.web/general/control.md)                                                  | An array of controls to be added to Panel2.                                                                             |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). The split container with the updated Panel2 controls.

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

```csharp

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

```

### ![](/files/lIX317sDtMTZJBi9oSIx) Panel2Collapsed\<TSplitContainer>(splitContainer, value)

Sets the Panel2Collapsed property of the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md).

| Parameter           | Type                                                                                              | Description                                                                                                       |
| ------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md). |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container for which to set the Panel2Collapsed property.                                                |
| **value**           | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                   | A boolean indicating whether Panel2 is collapsed.                                                                 |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). The modified split container with the updated Panel2Collapsed property.

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

```csharp

mySplitContainer.Panel2Collapsed(true);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) Panel2MinSize\<TSplitContainer>(splitContainer, size)

Sets the Panel2MinSize property of the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md).

| Parameter           | Type                                                                                              | Description                                                                                                       |
| ------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md). |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container for which to set the Panel2MinSize property.                                                  |
| **size**            | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                       | The minimum size of Panel2.                                                                                       |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). The modified split container with the updated Panel2MinSize property.

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

```csharp

mySplitContainer.Panel2MinSize(100);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) SplitterDistance\<TSplitContainer>(splitContainer, distance)

Sets the splitter distance for the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md), determining the size of Panel1.

| Parameter           | Type                                                                                              | Description                                                                                                             |
| ------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, which must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md). |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container for which to set the splitter distance.                                                             |
| **distance**        | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                       | The distance, in pixels, from the left or top edge of the split container to the splitter.                              |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). 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.

```csharp

mySplitContainer.SplitterDistance(150);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) SplitterWidth\<TSplitContainer>(splitContainer, width)

Sets the SplitterWidth property of the specified [SplitContainer](/api/wisej.web/containers/splitcontainer.md).

| Parameter           | Type                                                                                              | Description                                                                                                       |
| ------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **TSplitContainer** |                                                                                                   | The type of the split container, must inherit from [SplitContainer](/api/wisej.web/containers/splitcontainer.md). |
| **splitContainer**  | [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md) | The split container for which to set the SplitterWidth property.                                                  |
| **width**           | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                       | The width of the splitter.                                                                                        |

**Returns:** [TSplitContainer](/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md). The modified split container with the updated SplitterWidth property.

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

```csharp

mySplitContainer.SplitterWidth(10);

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.splittercontrolextensions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
