windowsforms-devexpress-dot-xtraeditors-dot-xtramessageboxargs-dab729f6.md
Gets image-related properties of an XtraMessageBox.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public MessageBoxImageOptions ImageOptions { get; }
Public ReadOnly Property ImageOptions As MessageBoxImageOptions
| Type | Description |
|---|---|
| DevExpress.XtraEditors.MessageBoxImageOptions |
Image-related properties.
|
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.
| |
Icon
|
Gets or sets the icon displayed in the message body.
| |
MessageBoxIcon
|
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;
}
Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
' Create and initialize an object with message box settings.
Dim args As New XtraMessageBoxArgs() With {
.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 Then
e.Cancel = True
End If
End Sub
See Also