Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

XtraMessageBoxArgs.ImageOptions Property

Gets image-related properties of an XtraMessageBox.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public MessageBoxImageOptions ImageOptions { get; }

#Property Value

Type Description
DevExpress.XtraEditors.MessageBoxImageOptions

Image-related properties.

#Remarks

The following table lists available settings:

Property

Description

Image

Gets or sets the raster image displayed in the message body.

SvgImage

Gets or sets the vector image displayed in the message body.

SvgImageSize

Gets or sets vector image size.

ImageUri

Gets or sets the uniform resource identifier that specifies a context-dependent image from the Image Gallery.

Icon

Gets or sets the icon displayed in the message body.

MessageBoxIcon

Gets or sets the MessageBoxIcon displayed in the message body.

SvgImageColorizationMode

Gets or sets how to adjust icon colors according to the active application skin.

The following example displays a vector image from an SvgImageCollection in the message box.

Note

svgImageCollection1 is created and populated at design time.

DevExpress WinForms XtraMessageBox assign SVG image

private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
  // Create and initialize an object with message box settings.
  XtraMessageBoxArgs args = new XtraMessageBoxArgs() {
    Caption = "Warning",
    Text = "Do you want to quit?",
    Buttons = new DialogResult[] { DialogResult.Yes, DialogResult.No }
    };
  // Assign a message box icon.
  args.ImageOptions.SvgImage = svgImageCollection1[0];
  args.ImageOptions.SvgImageSize = new Size(24, 24);
  // Display the message box and close the application if the user clicks "Yes".
  if (XtraMessageBox.Show(args) == DialogResult.No)
    e.Cancel = true;
}
See Also