Back to Devexpress

RichEditControl.DecryptionFailed Event

windowsforms-devexpress-dot-xtrarichedit-dot-richeditcontrol-f222a173.md

latest2.5 KB
Original Source

RichEditControl.DecryptionFailed Event

Occurs if the RichEditControl failed to open an encrypted file.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.XtraRichEdit.v25.2.dll

NuGet Package : DevExpress.Win.RichEdit

Declaration

csharp
public event DecryptionFailedEventHandler DecryptionFailed
vb
Public Event DecryptionFailed As DecryptionFailedEventHandler

Event Data

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

PropertyDescription
ExceptionReturns an exception that led to the event.

Remarks

The DecryptionFailed event is raised when the RichEditDocumentServer cannot decrypt a loaded file. Check the Exception property to determine the exception that led to this event.

The event also occurs if the EncryptedFilePasswordCheckFailedEventArgs.TryAgain property is not specified or set to false.

If the event is not handled, the RichEditControl does not load an empty file.

The code sample below shows how to handle the DecryptionFailed event to show an exception message.

csharp
private void RichEditControl1_DecryptionFailed(object sender, DecryptionFailedEventArgs e)
{
    MessageBox.Show(e.Exception.Message.ToString(), "Exception");
}
vb
Private Sub RichEditControl1_DecryptionFailed(ByVal sender As Object, ByVal e As DecryptionFailedEventArgs) Handles richEditControl1.DecryptionFailed
    MessageBox.Show(e.Exception.Message.ToString(), "Exception")
End Sub

See Also

RichEditControl Class

RichEditControl Members

DevExpress.XtraRichEdit Namespace