FlowLayoutPanelExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.1.0.0)
Adds fluent markup extension methods to the FlowLayoutPanel class.
- C#
- VB.NET
public class FlowLayoutPanelExtensions
Public Class FlowLayoutPanelExtensions
Methods
FillWeight<TPanel>(panel, control, value)
Sets the fill weight for a specified control within a FlowLayoutPanel.
| Parameter | Type | Description |
|---|---|---|
| TPanel | The type of the panel, constrained to FlowLayoutPanel. | |
| panel | TPanel | The panel on which to set the fill weight. |
| control | Control | The control for which to set the fill weight. |
| value | Int32 | An integer value representing the fill weight of the control. |
Returns: TPanel. 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.
var panel = new FlowLayoutPanel();
var button = new Button();
panel.FillWeight(button, 2);
FlowBreak<TPanel>(panel, control, value)
Sets the flow break for a specified control within a FlowLayoutPanel.
| Parameter | Type | Description |
|---|---|---|
| TPanel | The type of the panel, constrained to FlowLayoutPanel. | |
| panel | TPanel | The panel on which to set the flow break. |
| control | Control | The control for which to set the flow break. |
| value | Boolean | A boolean value indicating whether to set a flow break after the control. |
Returns: TPanel. 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.
var panel = new FlowLayoutPanel();
var button = new Button();
panel.FlowBreak(button, true);
FlowDirection<TPanel>(panel, direction)
Sets the flow direction for the specified FlowLayoutPanel control.
| Parameter | Type | Description |
|---|---|---|
| TPanel | The type of the panel, which must inherit from FlowLayoutPanel. | |
| panel | TPanel | The flow layout panel for which to set the flow direction. |
| direction | FlowDirection | The flow direction to be applied to the panel, specified as a FlowDirection value. |
Returns: TPanel. 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.
myFlowLayoutPanel.FlowDirection(FlowDirection.TopDown);
WrapContents<TPanel>(panel, wrap)
Sets the WrapContents property for the specified 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. | |
| panel | TPanel | The flow layout panel for which to set the WrapContents property. |
| wrap | Boolean | A boolean value indicating whether the contents should wrap. Default is true. |
Returns: TPanel. 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.
myFlowLayoutPanel.WrapContents(false);