Click or drag to resize

DynamicLayoutAddCentered Method

Adds a control centered in a new vertical section

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public void AddCentered(
	Control control,
	Nullable<Padding> padding = null,
	Nullable<Size> spacing = null,
	Nullable<bool> xscale = null,
	Nullable<bool> yscale = null,
	bool horizontalCenter = true,
	bool verticalCenter = true
)

Parameters

control
Type: Eto.FormsControl
Control to add
padding (Optional)
Type: SystemNullablePadding
Padding around the vertical section
spacing (Optional)
Type: SystemNullableSize
Spacing between cells
xscale (Optional)
Type: SystemNullableBoolean
Xscale for the vertical section
yscale (Optional)
Type: SystemNullableBoolean
Yscale for the vertical section
horizontalCenter (Optional)
Type: SystemBoolean
If set to true horizontally center the control
verticalCenter (Optional)
Type: SystemBoolean
If set to true vertically center the control
Remarks
This adds scaled blank space around the control, and sizes the control to its preferred size. This is similar to doing the following:
layout.BeginVertical(padding, spacing, xscale, yscale);
layout.Add(null); // spacing at top

layout.BeginHorizontal();
layout.Add(null); // spacing to left
layout.Add(control);
layout.Add(null); // spacing to right
layout.EndHorizontal();

layout.Add(null); // spacing at bottom

layout.EndVertical();
See Also