ThrowError Property  

Enable or disable error handling by the container of the control.


object.ThrowError = { True | False }


Error handling for methods can be done in either of two different styles, according to the value of this property.

If the ThrowError property is set to False, the application should check the return value of any method that is used, and report errors based upon the documented value of the return code. It is the responsibility of the application to interpret the error code, if it is desired to explain the error in addition to reporting it.

If the ThrowError property is set to True, then errors occurring within the control will be thrown to the container of the control. In addition, the OnError event will fire. For example, in Visual Basic, it is recommended that the OnError mechanism be used to catch errors.

Note that if an error occurs while a property value is being accessed, an error will be raised regardless of the value of the ThrowError property, but the OnError event will not be fired.

Data Type


See Also

LastError Property, OnError Event