XtraMessageBoxArgs.ImageOptions Property
Gets image-related properties of an XtraMessageBox.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v24.2.dll
Declaration
Property Value
Type | Description |
---|---|
DevExpress.XtraEditors.MessageBoxImageOptions | Image-related properties. |
Remarks
The following table lists available settings:
Property | Description |
---|---|
Gets or sets the raster image displayed in the message body. | |
Gets or sets the vector image displayed in the message body. | |
Gets or sets vector image size. | |
Gets or sets the uniform resource identifier that specifies a context-dependent image from the Image Gallery. | |
| Gets or sets the icon displayed in the message body. |
| Gets or sets the MessageBoxIcon displayed in the message body. |
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.
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;
}