FlowLayoutPanelExtensions

Wisej.Web.Markup.FlowLayoutPanelExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.0.0.0)

Adds fluent markup extension methods to the FlowLayoutPanel class.

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

The panel on which to set the fill weight.

control

The control for which to set the fill weight.

value

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

The panel on which to set the flow break.

control

The control for which to set the flow break.

value

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

The flow layout panel for which to set the flow direction.

direction

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

The flow layout panel for which to set the WrapContents property.

wrap

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);

Last updated

Was this helpful?