XmlFormCancelEventArgs Class

Provides data for the custom message that is displayed when canceling events raised by the form and its underlying XML document.

Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in microsoft.office.infopath.dll)

Syntax

'Declaration
'Usage

Remarks

The XmlFormCancelEvent object provides the Message and MessageDetails properties to specify or retrieve a custom message when canceling the Changing, Validating, Save, Merge, Submit, VersionUpgrade, and Loading events.

By default, the Message and MessageDetails properties have a null value.

  • When both values are null, the default error message is displayed when an event is cancelled.

  • When both values are non-null, then the values specified for the Message and MessageDetails properties are displayed in the error message dialog box.

  • If both properties are set to the empty string, then no text is displayed in the error message dialog box.

  • The Message property can be null and the MessageDetails property can be non-null, and vice-versa. If either one of the values is non-null, then InfoPath will display the specified value. For example, if Message is null, but MessageDetails has a value specified, InfoPath displays an error message dialog box with only the details section and no top-level text.

  • In the InfoPath design mode user interface, you can specify a custom message that is displayed when submitting succeeds or fails by using the Form Submit Options command on the Tools menu. If either the Message or MessageDetails properties are set in code, these values override any text specified in the InfoPath user interface.

Inheritance Hierarchy

System.Object
   System.EventArgs
     System.ComponentModel.CancelEventArgs
      Microsoft.Office.InfoPath.XmlFormCancelEventArgs
         Microsoft.Office.InfoPath.SaveCancelEventArgs

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

XmlFormCancelEventArgs Members
Microsoft.Office.InfoPath Namespace