Skip to main content

StackPanel.SetStretched(Control, Boolean) Method

Forces the control lying on the stack panel to occupy the entire free space available in this panel. The size of a stretched control cannot exceed this control’s MaximumSize. The control is strethed in the direction that matches the panel orientation (i.e., vertically for TopDown and BottomUp panels).

Namespace: DevExpress.Utils.Layout

Assembly: DevExpress.Utils.v24.1.dll

NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

Declaration

public void SetStretched(
    Control control,
    bool value
)

Parameters

Name Type Description
control Control

A control from the panel’s Controls collection.

value Boolean

true, to stretch the control; otherwise, false.

Remarks

Call the SetStretched method when you create and customize stack panels in code. At design time, you can use the Stretched extender property that appears for every control lying on a stack panel. In the figure below, a TextEdit control lying in between two SimpleButtons is stretched.

stack-panel

stackPanel3.SetStretched(textEdit10, true);
See Also