ControlGeneratedError Event
Topic Last Modified: 2006-06-13
The ControlGeneratedError Event is used for returning high-priority error information, for example, when the connection to the Exchange store is lost while performing an operation.
Applies To
Event Data
The event handler receives a ControlGeneratedEventArgs object as an argument containing data related to this event. The following properties provide information specific to this event.
Property | Description |
---|---|
The error message. |
|
The method in which the error occurred. |
Examples
Visual Basic .NET
The following is an example of a ControlGeneratedError event handler in Microsoft® Visual Basic® .NET.
Private Sub OnControlGeneratedError(ByVal o As Object, ByVal e As EventArgs) _
Handles treeView.ControlGeneratedError
' Declare the ControlGeneratedEventArgs object.
Dim evtArgs As ControlGeneratedEventArgs
' Cast e to a ControlGeneratedEventArgs object.
evtArgs = CType(e, ControlGeneratedEventArgs)
Debug.WriteLine("Error message: " + evtArgs.ErrorMessage)
Debug.WriteLine("Error occurred in: " + evtArgs.ErrorMethod)
End Sub
C#
The following is an example of a ControlGeneratedError event handler in Microsoft C#.
void OnControlGeneratedError(object o, EventArgs e )
{
// Cast e to a ControlGeneratedEventArgs object.
ControlGeneratedEventArgs evtArgs = (ControlGeneratedEventArgs)e;
Debug.WriteLine("Error message: " + evtArgs.ErrorMessage);
Debug.WriteLine("Error occurred in: " + evtArgs.ErrorMethod);
}