Compartir a través de


FormErrorCollection.Delete Method (String)

Deletes all FormError objects of the specified name from the FormErrorCollection object associated with the current form.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

Syntax

'Declaration
Public MustOverride Sub Delete ( _
    name As String _
)
'Usage
Dim instance As FormErrorCollection
Dim name As String

instance.Delete(name)
public abstract void Delete(
    string name
)

Parameters

Exceptions

Exception Condition
ArgumentException

The error is not of type FormErrorType.UserDefined.

ArgumentException

The error is not in the collection.

ArgumentNullException

The parameter passed to this method is a null reference (Nothing in Visual Basic).

ArgumentException

The parameter passed to this method is not valid. For example, it is of the wrong type or format.

Remarks

All errors of the specified name will be deleted from the collection (errors associated with different context nodes in the form can have the same name). Only errors of type ErrorType.UserDefined can be deleted from the collection. If the specified error is not user-defined, or is not in the collection, an exception is thrown.

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

This type or member can be accessed from code running in forms opened in Microsoft InfoPath Filler or in a Web browser.

Examples

In the following example, the Delete(name) method is used to delete the error name Field1Error from the FormErrorCollection object associated with the current form.

this.Errors.Delete("Field1Error");
Me.Errors.Delete("Field1Error")

See Also

Reference

FormErrorCollection Class

FormErrorCollection Members

Delete Overload

Microsoft.Office.InfoPath Namespace