FlowContainer
Layout wrapping into new rows or columns.
FlowContainer wraps eligible direct child Controls according to available length: horizontal flow produces rows; vertical flow produces columns. Unlike GridContainer, the column count is not fixed. Base FlowContainer orientation is mutable; HFlowContainer/VFlowContainer fix it and reject SetVertical.
Wrapping depends on available size, child desired/minimum/maximum sizes, SizeFlags and h_separation/v_separation theme constants. Row/column sizes can differ. Ordinary intermediate Entities, TopLevel and hidden Controls do not participate as ordinary layout items. The container replaces manual child Position.
Alignment places spare space within a line. LastWrapAlignment separately aligns the final incomplete line relative to the preceding one when it is not the first line; Inherit uses the main alignment. For example, with width 45 and two 20-wide items in the previous row, End places a final 20-wide item at X = 20 rather than 25. This assumes LTR and zero gaps.
ReverseFill changes filling across the main flow: horizontal rows can run bottom to top; vertical columns fill from the opposite edge with RTL taken into account. Tree child order does not change.
GetLineCount reads the previous layout cache: wait for sorting after resize. HFlow counts rows; VFlow counts columns. Neither child count nor a reliable emptiness test: an empty visible container can retain one empty line after a pass, and hidden containers can retain stale counts.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
FlowContainerConstructor
public FlowContainer();Creates mutable horizontal flow: Alignment = Begin, LastWrapAlignment = Inherit, ReverseFill = false. Wrapping requires a bounded available length.
Properties4
AlignmentProperty
public FlowContainer.AlignmentMode Alignment { get; set; }Main Begin/Center/End alignment of spare line space, Begin by default. Not individual-Control alignment or a fixed item count.
LastWrapAlignmentProperty
public FlowContainer.LastWrapAlignmentMode LastWrapAlignment { get; set; }Alignment of the final incomplete line relative to its predecessor when it is not the first line. Inherit uses Alignment. End does not unconditionally mean the entire container’s right/bottom edge.
ReverseFillProperty
public bool ReverseFill { get; set; }Reverses row/column filling across the main axis, false by default. Does not reorder tree children; horizontal placement accounts for RTL.
VerticalProperty
public bool Vertical { get; set; }false for rows, true for columns. Mutable only on base FlowContainer. Any setter call on HFlowContainer/VFlowContainer is rejected.
Methods9
GetAlignmentFlowContainer.AlignmentMode
public FlowContainer.AlignmentMode GetAlignment();Main Begin/Center/End alignment of spare line space, Begin by default. Not individual-Control alignment or a fixed item count.
FlowContainer.AlignmentModeCurrent setting rather than the result of a complete layout pass.
GetLastWrapAlignmentFlowContainer.LastWrapAlignmentMode
public FlowContainer.LastWrapAlignmentMode GetLastWrapAlignment();Alignment of the final incomplete line relative to its predecessor when it is not the first line. Inherit uses Alignment. End does not unconditionally mean the entire container’s right/bottom edge.
FlowContainer.LastWrapAlignmentModeCurrent setting rather than the result of a complete layout pass.
GetLineCountint
public int GetLineCount();Returns cached line count from the last layout: horizontal rows or vertical columns. Can be stale after resize/hiding; an empty container can report 1 after a pass. Not a child count.
intCached line count rather than a guaranteed current count of items/visible rows.
IsReverseFillbool
public bool IsReverseFill();Reverses row/column filling across the main axis, false by default. Does not reorder tree children; horizontal placement accounts for RTL.
boolCurrent setting rather than the result of a complete layout pass.
IsVerticalbool
public bool IsVertical();false for rows, true for columns. Mutable only on base FlowContainer. Any setter call on HFlowContainer/VFlowContainer is rejected.
boolCurrent setting rather than the result of a complete layout pass.
SetAlignmentvoid
public void SetAlignment(FlowContainer.AlignmentMode alignment);Main Begin/Center/End alignment of spare line space, Begin by default. Not individual-Control alignment or a fixed item count.
| Name | Type | Default |
|---|---|---|
alignment | FlowContainer.AlignmentMode | — |
alignmentBegin, Center or End respecting flow direction and RTL.
SetLastWrapAlignmentvoid
public void SetLastWrapAlignment(FlowContainer.LastWrapAlignmentMode lastWrapAlignment);Alignment of the final incomplete line relative to its predecessor when it is not the first line. Inherit uses Alignment. End does not unconditionally mean the entire container’s right/bottom edge.
| Name | Type | Default |
|---|---|---|
lastWrapAlignment | FlowContainer.LastWrapAlignmentMode | — |
lastWrapAlignmentInherit or Begin/Center/End relative to the previous line.
SetReverseFillvoid
public void SetReverseFill(bool reverseFill);Reverses row/column filling across the main axis, false by default. Does not reorder tree children; horizontal placement accounts for RTL.
| Name | Type | Default |
|---|---|---|
reverseFill | bool | — |
reverseFilltrue reverses cross-axis filling; false retains normal filling.
SetVerticalvoid
public void SetVertical(bool vertical);false for rows, true for columns. Mutable only on base FlowContainer. Any setter call on HFlowContainer/VFlowContainer is rejected.
| Name | Type | Default |
|---|---|---|
vertical | bool | — |
verticalBase FlowContainer axis only: true for columns, false for rows.
FlowContainer.AlignmentMode
| Value | Description |
|---|---|
Begin = 0 | The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout). |
Center = 1 | The child controls will be centered in the container. |
End = 2 | The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout). |
FlowContainer.LastWrapAlignmentMode
| Value | Description |
|---|---|
Begin = 1 | The last partially filled row or column will wrap aligned to the beginning of the previous row or column. |
Center = 2 | The last partially filled row or column will wrap aligned to the center of the previous row or column. |
End = 3 | The last partially filled row or column will wrap aligned to the end of the previous row or column. |
Inherit = 0 | The last partially filled row or column will wrap aligned to the previous row or column in accordance with |
Theme properties
These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.
| Key and type | Description |
|---|---|
h_separationint | The horizontal separation of child nodes. Default:4 |
v_separationint | The vertical separation of child nodes. Default:4 |