Back to Devexpress

LabelControl.HtmlImages Property

windowsforms-devexpress-dot-xtraeditors-dot-labelcontrol-883dc835.md

latest2.8 KB
Original Source

LabelControl.HtmlImages Property

Gets or sets a collection of images that can be inserted into the label using the image tag.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(null)]
[DXCategory("Appearance")]
public object HtmlImages { get; set; }
vb
<DefaultValue(Nothing)>
<DXCategory("Appearance")>
Public Property HtmlImages As Object

Property Value

TypeDefaultDescription
Objectnull

An image collection (DevExpress.Utils.ImageCollection or DevExpress.Utils.SvgImageCollection).

|

Remarks

Enable the LabelControl.AllowHtmlString property to use a set of HTML-inspired tags to format the control’s text (Text).

When you compose an HTML string, you can use the image tag to insert an image from an image collection and project’s resources into the text.

To insert an image from an image collection, do the following:

  • Create an image collection (ImageCollection or SvgImageCollection) and populate it with images.

  • Assign the collection to the HtmlImages property.

  • When you use the image tag, address a target image by its name (image names can be obtained from the image collection).

  • C#

  • VB.NET

csharp
labelControl1.AllowHtmlString = true;
labelControl1.HtmlImages = imageCollection1;
labelControl1.Text = "Person <image=person>";
vb
labelControl1.AllowHtmlString = True
labelControl1.HtmlImages = imageCollection1
labelControl1.Text = "Person <image=person>"

See HTML Text Formatting to learn more.

See Also

AllowHtmlString

HTML-inspired Text Formatting

LabelControl Class

LabelControl Members

DevExpress.XtraEditors Namespace