windowsforms-devexpress-dot-xtraeditors-dot-xtramessagebox-dot-show-x28-devexpress-dot-lookandfeel-dot-userlookandfeel-system-dot-string-system-dot-string-x29.md
Displays the XtraMessageBox with the specified look and feel settings, text and caption.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public static DialogResult Show(
UserLookAndFeel lookAndFeel,
string text,
string caption
)
Public Shared Function Show(
lookAndFeel As UserLookAndFeel,
text As String,
caption As String
) As DialogResult
| Name | Type | Description |
|---|---|---|
| lookAndFeel | UserLookAndFeel |
A UserLookAndFeel object whose properties specify the look and feel of the message box.
| | text | String |
A string value that specifies the text to display in the message box.
| | caption | String |
A string value that specifies the message box’s caption.
|
| Type | Description |
|---|---|
| DialogResult |
One of the DialogResult values.
|
The following code snippet displays an XtraMessageBox using the WXI skin, regardless of the application’s current skin.
const string text = "Hello DevExpress!";
const string caption = "Information";
var lookAndFeel = new UserLookAndFeel(this) { SkinName = "WXI", UseDefaultLookAndFeel = false };
XtraMessageBox.Show(lookAndFeel, text, caption);
| Parameter | Default Value | Property Name |
|---|---|---|
Caption | String.Empty | Caption |
Buttons | MessageBoxButtons.OK | Buttons |
DefaultButtonIndex | 0 | DefaultButtonIndex |
Owner | null | Owner |
Icon | MessageBoxIcon.None | ImageOptions |
The following code snippet displays the XtraMessageBox with formatted text and a warning icon. If the user clicks Yes , the application closes the current form.
using DevExpress.XtraEditors;
using DevExpress.Utils;
if(XtraMessageBox.Show(
"Do you want to close the <b>form</b>?", "Warning",
MessageBoxButtons.YesNo, MessageBoxIcon.Warning,
DefaultBoolean.True) == DialogResult.Yes)
this.Close();
Imports DevExpress.XtraEditors
Imports DevExpress.Utils
If XtraMessageBox.Show("Do you want to close the <b>form</b>?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, DefaultBoolean.True) = DialogResult.Yes Then
Me.Close()
End If
See Also