Back to Devexpress

XtraBaseArgs.HtmlImages Property

windowsforms-devexpress-dot-xtraeditors-dot-xtrabaseargs-dbb587ea.md

latest4.0 KB
Original Source

XtraBaseArgs.HtmlImages Property

Gets or sets ImageCollection or SvgImageCollection. XtraMessageBox can display images from this collection.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public object HtmlImages { get; set; }
vb
Public Property HtmlImages As Object

Property Value

TypeDescription
Object

An object that is an image collection.

|

Remarks

XtraMessageBox messages support HTML tags and can display images from ImageCollection or SvgImageCollection.

To display an image, allow HTML text(via the AllowHtmlText property) and assign an image collection to HtmlImages. Then add the “Image” tag to the Text and specify an image from a collection:

csharp
XtraMessageBoxArgs args = new XtraMessageBoxArgs();
args.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
args.HtmlImages = htmlImageCollection;
args.Caption = "Message";
args.Text = "<image=img.png>Text";
XtraMessageBox.Show(args);
vb
Dim args As New XtraMessageBoxArgs()
args.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True
args.HtmlImages = htmlImageCollection
args.Caption = "Message"
args.Text = "<image=img.png>Text"
XtraMessageBox.Show(args)

You can combine “image” with other HTML tags, for example the <p> tag, available for v20.1 and newer. This tag supports the “align” parameter that allows you to arrange an image as needed.

csharp
XtraMessageBoxArgs args = new XtraMessageBoxArgs();
args.AllowHtmlText = DefaultBoolean.True;
svgImageCollection1.ImageSize = new Size(48, 48);
args.HtmlImages = svgImageCollection1;
args.Text = "<p align=center><image=warning>
" +
    "<b>Something went wrong</b>
" +
    "We're having technical issues at the moment.
" +
    "Please try again later.</p>";
args.Caption = "Warning";
args.Buttons = new DialogResult[] { DialogResult.OK };
XtraMessageBox.Show(args);
vb
Dim args As New XtraMessageBoxArgs()
args.AllowHtmlText = DefaultBoolean.True
svgImageCollection1.ImageSize = New Size(48, 48)
args.HtmlImages = svgImageCollection1
args.Text = "<p align=center><image=warning>
" & "<b>Something went wrong</b>
" & "We're having technical issues at the moment.
" & "Please try again later.</p>"
args.Caption = "Warning"
args.Buttons = New DialogResult() { DialogResult.OK }
XtraMessageBox.Show(args)

Use the ImageOptions property to display an image in the message.

See Also

XtraBaseArgs Class

XtraBaseArgs Members

DevExpress.XtraEditors Namespace