WindowsFormsApplicationBase.OnUnhandledException Method

Note: This method is new in the .NET Framework version 2.0.

When overridden in a derived class, allows for code to run when an unhandled exception occurs in the application.

Namespace: Microsoft.VisualBasic.ApplicationServices
Assembly: Microsoft.VisualBasic (in microsoft.visualbasic.dll)

protected virtual bool OnUnhandledException (
	UnhandledExceptionEventArgs e
protected boolean OnUnhandledException (
	UnhandledExceptionEventArgs e
protected function OnUnhandledException (
	e : UnhandledExceptionEventArgs
) : boolean




Return Value

A Boolean indicating whether the UnhandledException event was raised.

By default, this method raises the UnhandledException event as long as a debugger is not attached and the user is handling the UnhandledException event. The event handler can set the ExitApplication property. If ExitApplication is False, or if the event is not handled, the application exits upon return from the exception handler. Otherwise, control of the application is returned to the Windows Forms message loop.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions