Back to Devexpress

Length.UnitType Property

windowsforms-devexpress-dot-xtrabars-dot-docking2010-dot-views-dot-widget-dot-length.md

latest4.6 KB
Original Source

Length.UnitType Property

Gets or sets the way a StackGroup‘s, RowDefinition‘s or ColumnDefinition‘s length is measured.

Namespace : DevExpress.XtraBars.Docking2010.Views.Widget

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(LengthUnitType.Star)]
[XtraSerializableProperty]
public LengthUnitType UnitType { get; set; }
vb
<DefaultValue(LengthUnitType.Star)>
<XtraSerializableProperty>
Public Property UnitType As LengthUnitType

Property Value

TypeDefaultDescription
LengthUnitTypeStar

A LengthUnitType enumerator value that specifies the way a StackGroup‘s, RowDefinition‘s or ColumnDefinition‘s length is measured.

|

Available values:

NameDescription
Pixel

The Length.UnitValue property value is the number of pixels that a StackGroup occupies.

| | Star |

The Length.UnitValue property value is the relative length multiplier.

|

Remarks

The UnitType property can equal either LengthUnitType.Pixel or LengthUnitType.Star. Pixel-measured Stack Groups/Rows/Columns are given the precise length specified via the Length.UnitValue property. Star-measured Groups/Rows/Columns are resized dynamically, depending on the available free space. In this case, the UnitValue property value is a relative length multiplier, specifying how much this Group is wider or narrower than other star-measured Groups. See the Widget View topic for the details.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the UnitType property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-create-widgetview-runtime/CS/WidgetViewExample/Form1.cs#L47

csharp
group2 = new StackGroup();
group1.Length.UnitType = LengthUnitType.Star;
group1.Length.UnitValue = 2;

winforms-create-widgetview-runtime/VB/WidgetViewExample/Form1.vb#L47

vb
group2 = New StackGroup()
group1.Length.UnitType = LengthUnitType.Star
group1.Length.UnitValue = 2

See Also

UnitValue

Widget View

Length Class

Length Members

DevExpress.XtraBars.Docking2010.Views.Widget Namespace