Table of Contents

Property Modified

Namespace
Alternet.Editor
Assembly
Alternet.Editor.v9.dll

Modified

Gets or sets a value indicating whether the control's text content is modified.

[Browsable(false)]
public virtual bool Modified { get; set; }

Property Value

bool

Examples

Here is how to use a Modified in the C# code:

public partial class Form1 : Form
{
    private void Form1_Load(object sender, EventArgs e)
    {
        var syntaxEdit1 = new Alternet.Editor.SyntaxEdit(this.components);
    }

    private void SaveEditor_Click(object sender, EventArgs e)
    {
        if (syntaxEdit1.Modified && !string.IsNullOrEmpty(syntaxEdit1.Source.FileName))
        {
            syntaxEdit1.SaveFile(syntaxEdit1.Source.FileName);
            syntaxEdit1.Modified = false;
        }
    }
}

Here is how to use a Modified in the Visual Basic code:

Partial Public Class Form1
    Inherits Form

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim syntaxEdit1 = New Alternet.Editor.SyntaxEdit(Me.components)
    End Sub

    Private Sub SaveEditor_Click(ByVal sender As Object, ByVal e As EventArgs)
        If syntaxEdit1.Modified AndAlso Not String.IsNullOrEmpty(syntaxEdit1.Source.FileName) Then
            syntaxEdit1.SaveFile(syntaxEdit1.Source.FileName)
            syntaxEdit1.Modified = False
        End If
    End Sub
End Class

Remarks

The Modified property can be used to determine whether the user has changed the contents of the SyntaxEdit control since it was the last set or loaded from the file.�

You can also set this property in code to indicate that changes were made to the SyntaxEdit control by the application.

This property can be used by validation and data-saving methods to determine if changes were made in a SyntaxEdit control so the changed contents can be validated or saved.