Back to Devexpress

RepositoryItemImageComboBox.GlyphAlignment Property

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemimagecombobox-0f81810c.md

latest5.8 KB
Original Source

RepositoryItemImageComboBox.GlyphAlignment Property

Gets or sets the alignment of item images.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

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

Property Value

TypeDefaultDescription
HorzAlignmentNear

The HorzAlignment value that specifies the alignment of item images.

|

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 ImageComboBoxItem.ImageIndex property to assign an image to an item. The GlyphAlignment property specifies the image alignment.

|

HorzAlignment value

|

Image

| | --- | --- | |

HorzAlignment.Near

|

| |

HorzAlignment.Center

|

The edit box does not display the selected item’s text. Item images are left-aligned in the dropdown.

| |

HorzAlignment.Far

|

|

If the image is aligned at the center, the item caption (see ImageComboBoxItem.Description) is hidden in the edit box. However, if the ImageComboBoxEdit control is used to edit a column in a Grid, Vertical Grid, Tree List, or Search Lookup Editor control, the Find Panel still finds the hidden captions.

The following code snippets (auto-collected from DevExpress Examples) contain references 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-generate-skin-palettes-with-ai/CS/DevExpress.AI.WinForms.AIGeneratePalette.Demo/Model/EmployeeDataHelper.cs#L336

csharp
if(edit == null)
    ret.GlyphAlignment = HorzAlignment.Center;
return ret;

winforms-textedit-advanced-mode/CS/TextEditSample/EmployeeDataHelper.cs#L168

csharp
if(edit == null)
    ret.GlyphAlignment = HorzAlignment.Center;
return ret;

winforms-grid-display-icons-in-data-cells/VB/Form1.vb#L172

vb
imageCombo.Items.Add(New ImageComboBoxItem("Severe", 3, 2))
imageCombo.GlyphAlignment = DevExpress.Utils.HorzAlignment.Center
gridControl1.RepositoryItems.Add(imageCombo)

winforms-textedit-advanced-mode/VB/TextEditSample/EmployeeDataHelper.vb#L180

vb
If edit Is Nothing Then
    ret.GlyphAlignment = HorzAlignment.Center
End If

See Also

ImageIndex

SmallImages

LargeImages

RepositoryItemImageComboBox Class

RepositoryItemImageComboBox Members

DevExpress.XtraEditors.Repository Namespace