windowsforms-devexpress-dot-utils-dot-contextitem-96f8dc4f.md
Gets or sets the current item’s alignment relative to the owner control. This property is obsolete, use ContextItem.AlignmentOptions instead.
Namespace : DevExpress.Utils
Assembly : DevExpress.Utils.v25.2.dll
NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core
[Browsable(false)]
[DefaultValue(ContextItemAlignment.TopNear)]
[DXCategory("Layout")]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual ContextItemAlignment Alignment { get; set; }
<Browsable(False)>
<EditorBrowsable(EditorBrowsableState.Never)>
<DXCategory("Layout")>
<DefaultValue(ContextItemAlignment.TopNear)>
Public Overridable Property Alignment As ContextItemAlignment
| Type | Default | Description |
|---|---|---|
| DevExpress.Utils.ContextItemAlignment | TopNear |
A ContextItemAlignment enumeration value that specifies the current item’s alignment relative to the owner control.
|
The Alignment property specifies the alignment of the current item relative to the owner control. Depending on the item’s alignment, it is:
placed in the corresponding panel: top, bottom, near, far, or center (the first statement of the ContextItemAlignment enumeration value specifies the panel into which the item is placed);
aligned relative to the panel: near, far, or middle for horizontally oriented panels; top, bottom, or center for vertically oriented (the second statement of the value).
To specify the panel’s back color and padding, use the corresponding settings accessible through the owner control’s ContextButtonOptions property.
If aligning relative to the owner control does not meet your needs, you can align the current item relative to another item—anchor element. See the ContextItem.AnchorAlignment property for more information.
See Also