Skip to main content
.NET Framework 4.5.2+
  • The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.

WinApplication.CustomHandleException Event

Occurs before displaying a message box with an exception message.

Namespace: DevExpress.ExpressApp.Win

Assembly: DevExpress.ExpressApp.Win.v23.1.dll

NuGet Package: DevExpress.ExpressApp.Win


public event EventHandler<CustomHandleExceptionEventArgs> CustomHandleException

Event Data

The CustomHandleException event's data class is CustomHandleExceptionEventArgs. The following properties provide information specific to this event:

Property Description
Exception Gets the exception that occurred.
Handled Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. Inherited from HandledEventArgs.
OriginalException Gets the original exception.


Raised as the result of executing the WinApplication.HandleException method. Handle the CustomHandleException event to customize the exceptions processing in a Windows Forms application. Place a custom code in this event handler, and it will be executed before the message box is shown. The exception that occurs is accessible via the Exception parameter. You can set the handler’s Handled parameter, to prohibit displaying the default message box.

static class Program {
    static void Main() {
        // ...
        MySolutionWindowsFormsApplication winApplication = 
            new MySolutionWindowsFormsApplication();
        winApplication.CustomHandleException += winApplication_CustomHandleException;
        // ...
        try {
        catch (Exception e) {
    // ...
    static void winApplication_CustomHandleException(
        object sender, CustomHandleExceptionEventArgs e) {
        // Place your code here. Set e.Handled to true to prohibit displaying default message box.
See Also