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
)
Public Sub AddCentered (
control As Control,
Optional padding As Nullable(Of Padding) = Nothing,
Optional spacing As Nullable(Of Size) = Nothing,
Optional xscale As Nullable(Of Boolean) = Nothing,
Optional yscale As Nullable(Of Boolean) = Nothing,
Optional horizontalCenter As Boolean = true,
Optional verticalCenter As Boolean = true
)
member AddCentered :
control : Control *
?padding : Nullable<Padding> *
?spacing : Nullable<Size> *
?xscale : Nullable<bool> *
?yscale : Nullable<bool> *
?horizontalCenter : bool *
?verticalCenter : bool
(* Defaults:
let _padding = defaultArg padding null
let _spacing = defaultArg spacing null
let _xscale = defaultArg xscale null
let _yscale = defaultArg yscale null
let _horizontalCenter = defaultArg horizontalCenter true
let _verticalCenter = defaultArg verticalCenter true
*)
-> unit
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);
layout.BeginHorizontal();
layout.Add(null);
layout.Add(control);
layout.Add(null);
layout.EndHorizontal();
layout.Add(null);
layout.EndVertical();
See Also