# FlowLayoutPanelExtensions

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 [FlowLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flowlayoutpanel) class.

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

```csharp
public class FlowLayoutPanelExtensions
```

{% endtab %}

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

```visual-basic
Public Class FlowLayoutPanelExtensions
```

{% endtab %}
{% endtabs %}

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) FillWeight\<TPanel>(panel, control, value)

Sets the fill weight for a specified control within a [FlowLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flowlayoutpanel).

| Parameter   | Type                                                                                                        | Description                                                                                                               |
| ----------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **TPanel**  |                                                                                                             | The type of the panel, constrained to [FlowLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flowlayoutpanel). |
| **panel**   | [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flowlayoutpanelextensions) | The panel on which to set the fill weight.                                                                                |
| **control** | [Control](https://docs.wisej.com/api/wisej.web/general/control)                                             | The control for which to set the fill weight.                                                                             |
| **value**   | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                                 | An integer value representing the fill weight of the control.                                                             |

**Returns:** [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flowlayoutpanelextensions). The *TPanel* instance with the updated fill weight setting.

This method allows you to specify the relative fill weight of a control within a [FlowLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flowlayoutpanel).

```csharp

var panel = new FlowLayoutPanel();
var button = new Button();
panel.FillWeight(button, 2);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) FlowBreak\<TPanel>(panel, control, value)

Sets the flow break for a specified control within a [FlowLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flowlayoutpanel).

| Parameter   | Type                                                                                                        | Description                                                                                                               |
| ----------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **TPanel**  |                                                                                                             | The type of the panel, constrained to [FlowLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flowlayoutpanel). |
| **panel**   | [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flowlayoutpanelextensions) | The panel on which to set the flow break.                                                                                 |
| **control** | [Control](https://docs.wisej.com/api/wisej.web/general/control)                                             | The control for which to set the flow break.                                                                              |
| **value**   | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                             | A boolean value indicating whether to set a flow break after the control.                                                 |

**Returns:** [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flowlayoutpanelextensions). The *TPanel* instance with the updated flow break setting.

This method allows you to specify whether a control should be the last one on a line in a [FlowLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flowlayoutpanel).

```csharp

var panel = new FlowLayoutPanel();
var button = new Button();
panel.FlowBreak(button, true);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) FlowDirection\<TPanel>(panel, direction)

Sets the flow direction for the specified [FlowLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flowlayoutpanel) control.

| Parameter     | Type                                                                                                        | Description                                                                                                                        |
| ------------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **TPanel**    |                                                                                                             | The type of the panel, which must inherit from [FlowLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flowlayoutpanel). |
| **panel**     | [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flowlayoutpanelextensions) | The flow layout panel for which to set the flow direction.                                                                         |
| **direction** | [FlowDirection](https://docs.wisej.com/api/wisej.web/containers/flowlayoutpanel/wisej.web.flowdirection)    | The flow direction to be applied to the panel, specified as a [FlowDirection](#flowdirection``1) value.                            |

**Returns:** [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flowlayoutpanelextensions). The flow layout panel with the updated flow direction.

This method allows you to control the direction in which the child controls are laid out within the flow layout panel.

```csharp

myFlowLayoutPanel.FlowDirection(FlowDirection.TopDown);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) WrapContents\<TPanel>(panel, wrap)

Sets the WrapContents property for the specified [FlowLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flowlayoutpanel) control, determining whether the contents should wrap to the next line or column.

| Parameter  | Type                                                                                                        | Description                                                                                                                        |
| ---------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **TPanel** |                                                                                                             | The type of the panel, which must inherit from [FlowLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flowlayoutpanel). |
| **panel**  | [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flowlayoutpanelextensions) | The flow layout panel for which to set the WrapContents property.                                                                  |
| **wrap**   | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                             | A boolean value indicating whether the contents should wrap. Default is `true`.                                                    |

**Returns:** [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flowlayoutpanelextensions). The flow layout panel with the updated WrapContents property.

This method allows you to specify whether the child controls should wrap to the next line or column when they exceed the panel's bounds.

```csharp

myFlowLayoutPanel.WrapContents(false);

```
