Back to Devexpress

BaseRepositoryItemCheckEdit.GlyphAlignment Property

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-baserepositoryitemcheckedit-e72b22aa.md

latest4.4 KB
Original Source

BaseRepositoryItemCheckEdit.GlyphAlignment Property

Gets or sets the horizontal alignment of a check box glyph within a check editor.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Behavior")]
public virtual HorzAlignment GlyphAlignment { get; set; }
vb
<DXCategory("Behavior")>
Public Overridable Property GlyphAlignment As HorzAlignment

Property Value

TypeDescription
HorzAlignment

A DevExpress.Utils.HorzAlignment enumeration value specifying the check box’s horizontal alignment.

|

Available values:

NameDescription
Default

Places an object or text at the default position, which is determined by a control.

| | Near |

Places an object/text at a near position.

| | Center |

Centers an object or text within a region.

| | Far |

Places an object/text at a far position.

|

Remarks

Use the GlyphAlignment property to specify the horizontal alignment of the glyph representing a check box within a check editor. This property also affects the editor’s caption text alignment. If the GlyphAlignment property is set to Center , the caption text is hidden and only the check box is displayed.

Assigning a new value for the GlyphAlignment property at runtime generates the RepositoryItem.PropertiesChanged event.

The following images demonstrate the check box aligned to the center and to the right respectively.

You can also specify the vertical alignment of the glyph using the BaseRepositoryItemCheckEdit.GlyphVAlignment property.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GlyphAlignment 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-grid-enable-editing-in-group-row-to-change-cell-values/CS/WindowsApplication3/GroupEditProvider.cs#L143

csharp
if (groupEdit is CheckEdit)
    (groupEdit as CheckEdit).Properties.GlyphAlignment = HorzAlignment.Center;
groupEdit.KeyDown += OnGroupEditKeyDown;

winforms-grid-enable-editing-in-group-row-to-change-cell-values/VB/WindowsApplication3/GroupEditProvider.vb#L138

vb
If TypeOf groupEdit Is CheckEdit Then
    TryCast(groupEdit, CheckEdit).Properties.GlyphAlignment = HorzAlignment.Center
End If

See Also

GlyphVAlignment

Caption

BaseRepositoryItemCheckEdit Class

BaseRepositoryItemCheckEdit Members

DevExpress.XtraEditors.Repository Namespace