Back to Devexpress

XtraMessageBox.Icons Property

windowsforms-devexpress-dot-xtraeditors-dot-xtramessagebox-d7109b14.md

latest2.5 KB
Original Source

XtraMessageBox.Icons Property

Allows you to specify custom XtraMessageBox icons using predefined icon names.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public static Dictionary<MessageBoxIcon, Icon> Icons { get; }
vb
Public Shared ReadOnly Property Icons As Dictionary(Of MessageBoxIcon, Icon)

Property Value

TypeDescription
Dictionary<MessageBoxIcon, Icon>

A Dictionary<TKey,TValue><MessageBoxIcon,Icon,> object that stores predefined XtraMessageBox icons.

|

Remarks

The static Icons collection contains predefined XtraMessageBox icons. To display a custom icon in all XtraMessageBoxes instead of the predefined default icon, use its predefined icon name.

The following code snippet displays a custom exclamation icon in an XtraMessageBox:

csharp
Icon customIcon = new Icon("C:\\MyCustomIcon.ico");
XtraMessageBox.Icons[MessageBoxIcon.Exclamation] = customIcon;
XtraMessageBox.Show("text", "caption", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
vb
Dim customIcon As New Icon("C:\MyCustomIcon.ico")
XtraMessageBox.Icons(MessageBoxIcon.Exclamation) = customIcon
XtraMessageBox.Show("text", "caption", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation)

See Also

XtraMessageBox

XtraMessageBox Members

DevExpress.XtraEditors Namespace