Partager via


XmlForm.Dirty Property

Gets or sets a value that indicates whether the data in a form has been modified since it was last saved.

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

Syntax

'Declaration
Public MustOverride Property Dirty As Boolean
    Get
    Set
'Usage
Dim instance As XmlForm
Dim value As Boolean

value = instance.Dirty

instance.Dirty = value
public abstract bool Dirty { get; set; }

Property Value

Type: System.Boolean
true if the data in the form has been modified since it was last saved; otherwise false.

Remarks

If the Dirty property is true, data in the form's underlying XML document has been changed since it was last saved. If false, no changes have occurred.

Note

Changes that occur during a Loading event will not result in the Dirty property being set to true.

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.

Examples

In the following code example, the Dirty property of the XmlForm class is used to determine whether data in the form has been changed.

if (this.Dirty)
{
   MessageBox.Show("Data has been changed.");
}
else
{
   MessageBox.Show("Data has not been changed.");
}
If (Me.Dirty) Then
   MessageBox.Show("Data has been changed.")
Else
   MessageBox.Show("Data has not been changed.")
End If

See Also

Reference

XmlForm Class

XmlForm Members

Microsoft.Office.InfoPath Namespace