Modifier

Partager via


ExceptionRoutedEventArgs.ErrorException Property

Definition

Gets the exception that caused the error condition.

public:
 property Exception ^ ErrorException { Exception ^ get(); };
public Exception ErrorException { get; }
member this.ErrorException : Exception
Public ReadOnly Property ErrorException As Exception

Property Value

The exception that details the specific error condition.

Exceptions

The attempt to access the media file is denied.

The media file is not found.

The media file format is not supported by any installed codec.

-or-

The file format is not recognized.

Windows Media Player version 10 or later is not detected.

-or-

Video resources are insufficient for media playback.

A COM error code appears.

Examples

The following example creates a simple event handler for ExceptionRoutedEventArgs.

private void Media_MediaFailed(object sender, ExceptionRoutedEventArgs args)
{
    MessageBox.Show(args.ErrorException.Message);
}
Private Sub Media_MediaFailed(ByVal sender As Object, ByVal args As ExceptionRoutedEventArgs)
    If (True) Then
        MessageBox.Show(args.ErrorException.Message)
    End If
End Sub

Applies to