Back to Devexpress

BaseLayoutItem.TextLocation Property

windowsforms-devexpress-dot-xtralayout-dot-baselayoutitem-a9ccf7c0.md

latest4.5 KB
Original Source

BaseLayoutItem.TextLocation Property

Gets or sets the item caption position.

Namespace : DevExpress.XtraLayout

Assembly : DevExpress.XtraLayout.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(Locations.Default)]
[DXCategory("Text")]
[XtraSerializableProperty]
public virtual Locations TextLocation { get; set; }
vb
<DefaultValue(Locations.Default)>
<DXCategory("Text")>
<XtraSerializableProperty>
Public Overridable Property TextLocation As Locations

Property Value

TypeDefaultDescription
LocationsDefault

A Locations value that specifies the item caption position.

|

Available values:

NameDescription
Default

The same as the Locations.Top option.

| | Left |

An element is located at the left edge of another element.

| | Right |

An element is located at the right edge of another element.

| | Top |

An element is located at the top edge of another element.

| | Bottom |

An element is located at the bottom edge of another element.

|

Remarks

Use the BaseLayoutItem.Text property to set the layout item caption, and the TextLocation property to specify its position. Each layout item type interprets the TextLocation property values differently.

  • LayoutControlItem items place their caption blocks relative to controls hosted inside these items.

  • LayoutControlGroup items align their caption blocks along their sides.

  • TabbedControlGroup items use the TextLocation property to align tab headers along group sides.

The Locations.Default value is equal to Locations.Left if the Right-to-Left Layout mode is off, and Locations.Right otherwise.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TextLocation 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-dashboard-custom-properties/CS/WinForms-Dashboard-Custom-Properties/Modules/DashboardDescriptionModule.cs#L47

csharp
LayoutControlItem memoEditLayoutItem = layoutControl.Root.AddItem();
memoEditLayoutItem.TextLocation = Locations.Top;
memoEditLayoutItem.Text = "Text:";

winforms-dashboard-custom-properties/VB/WinForms-Dashboard-Custom-Properties/Modules/DashboardDescriptionModule.vb#L47

vb
Dim memoEditLayoutItem As LayoutControlItem = layoutControl.Root.AddItem()
memoEditLayoutItem.TextLocation = Locations.Top
memoEditLayoutItem.Text = "Text:"

See Also

Text

TextSize

TextToControlDistance

TextVisible

BaseLayoutItem Class

BaseLayoutItem Members

DevExpress.XtraLayout Namespace