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.v21.2.dll


public void SetStretched(
    Control control,
    bool value


Name Type Description
control Control

A control from the panel’s Controls collection.

value Boolean

true, to stretch the control; otherwise, false.


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.


stackPanel3.SetStretched(textEdit10, true);
See Also