[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Collapse]Messages, Notifications, and Dialogs
    Input Box
    Flyout Dialog
    Flyout Panel
   [Expand]Alert Windows
    Toast Notification Manager
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)


The XtraMessageBox replaces standard Windows Forms message boxes which do not support DevExpress skins.

Expanded Show Message Boxes

To display an XtraMessageBox, call the static (Shared in VB) XtraMessageBox.Show method. The method overloads allow you to specify the message's caption, icon, text, buttons, etc. The sample code below prevents an application from closing if a user clicks "No".


You can use the XtraDialog class to display messages with a more complex layout.

Expanded Auto-Close Message Boxes

The XtraMessageBox.Show method overload allows you to show a message box that closes automatically. The method parameter is the XtraMessageBoxArgs class object and provides the AutoCloseOptions.Delay property that allows you to set the auto-close timeout (in milliseconds).

The first message box button ("OK" in the sample above) is a default button - if a user presses "Enter" or the auto-closing timer expires, this button is considered clicked, and the message box returns the corresponding DialogResult value. This button also displays the countdown timer for auto-closing messages.

You can modify the XtraBaseArgs.DefaultButtonIndex property to select the default button and disable the AutoCloseOptions.ShowTimerOnDefaultButton setting to hide the countdown timer.

Expanded Additional Customization

Invoke message boxes using the XtraMessageBox.Show method overload and handle this method parameter's XtraBaseArgs.Showing event to perform message box customizations.

Modify message box buttons

The code below illustrates how to add custom icons to message box buttons. In this example, icons are vector images stored in the external SvgImageCollection.

Change appearance and font settings

The example below increases the message box button's height and font size, and makes the text bold.

Change button alignment

Use the XtraMessageBox.ButtonsAlignment static (Shared in VB) property to specify the button alignment. The example below aligns message box buttons at the right.

Is this topic helpful?​​​​​​​