StackLayoutPanel
Arranges child elements into a single line that can be oriented horizontally or vertically.
StackLayoutPanel provides sophisticated linear layout functionality, allowing elements to be arranged either horizontally or vertically. It supports advanced features including element wrapping when space is exceeded, equal sizing modes, forced element dimensions, and specialized strip mode behavior.
Key capabilities include:
- Horizontal and vertical orientation support with automatic layout direction
- Element wrapping to new rows or columns when available space is exceeded
- Equal sizing modes for creating uniform element dimensions
- Right-to-left layout support with automatic content alignment adjustment
- Strip mode for single-line layouts without wrapping behavior
- Collapse elements on resize for responsive layout behavior
This layout panel is extensively used in toolbars, button panels, menu bars, ribbon controls, and other UI areas where elements need linear arrangement with intelligent space management. The panel automatically handles content alignment, element spacing, and responsive behavior across different screen sizes and orientations.
Definition
Namespace:Telerik.WinControls.Layouts
Assembly:Telerik.WinControls.dll
Syntax:
public class StackLayoutPanel : LayoutPanel, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode
Inheritance: objectDisposableObjectRadObjectRadElementLayoutPanelStackLayoutPanel...
Derived Classes:
Implements:
Inherited Members
Constructors
public StackLayoutPanel()
Fields
Identifies the property that makes visible children share the largest desired height; in horizontal orientation, that height can expand to the available panel height.
public static readonly RadProperty EqualChildrenHeightProperty
Identifies the property that makes visible children share the largest desired width; in vertical orientation, that width can expand to the available panel width.
public static readonly RadProperty EqualChildrenWidthProperty
[Obsolete("The property is not relevant for this class.")]
public static RadProperty FlipMaxSizeDimensionsProperty
Identifies the property that controls whether children are stacked horizontally or vertically.
public static RadProperty OrientationProperty
public static RadProperty RowProperty
Properties
Gets or sets a value indicating whether the elements have equal height.
public bool EqualChildrenHeight { get; set; }
Gets or sets a value indicating whether the elements have equal width.
public bool EqualChildrenWidth { get; set; }
Notifies all children when same child changes. Effectively redraws all children in the panel.
public override bool InvalidateChildrenOnChildChanged { get; }
Overrides:
Gets or sets the elements orientation inside the stack layout. Possible values are horizontal and vertical.
public Orientation Orientation { get; set; }
Methods
Measures the children along the stacking axis and returns the combined desired size.
protected override SizeF MeasureOverride(SizeF constraint)
The available size; measurement is unbounded along the stacking axis and constrained on the other axis.
Returns:A size that sums child sizes along the stacking axis and uses the largest child size on the other axis. When equal child sizing is enabled, the corresponding dimension uses the largest measured child dimension.
Overrides: