Version

StartEditMode Method (ValueEditor)

Enters edit mode.
Overload List
OverloadDescription
StartEditMode()Enters edit mode.  
Example
The following code demonstrates OriginalValue and HasValueChanged properties. It also makes use of StartEditMode and EndEditMode to enter and exit edit mode.

Private Sub Button1_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
        ' When edit mode ends, the value will be committed and OriginalValue and
        ' HasValueChanged will be reset.
        Me.textEditor1.EndEditMode(True, False)

        Me.textEditor1.Value = "A"

        ' HasValueChanged and OriginalValue properties are only applicable during
        ' edit mode. These properties are set when the value of the editor is
        ' modified after entering edit mode.
        Me.textEditor1.StartEditMode()

        ' The following will print out 'A' and False respectively.
        Debug.WriteLine("After entering edit mode:")
        Debug.WriteLine("OriginalValue = '" & Me.textEditor1.OriginalValue & "'")
        Debug.WriteLine("HasValueChanged = " & Me.textEditor1.HasValueChanged)

        Me.textEditor1.Value = "B"

        ' The Value was modified to B above. The following will print out 'A' and 
        ' True respectively.
        Debug.WriteLine("After changing value to B:")
        Debug.WriteLine("OriginalValue = '" & Me.textEditor1.OriginalValue & "'")
        Debug.WriteLine("HasValueChanged = " & Me.textEditor1.HasValueChanged)

        ' When edit mode ends, the value will be committed and HasValueChanged will 
        ' be reset.
        Me.textEditor1.EndEditMode(True, False)

        ' The following will print out False.
        Debug.WriteLine("After exiting edit mode:")
        Debug.WriteLine("HasValueChanged = " & Me.textEditor1.HasValueChanged)
    End Sub
public void button1_Click( object sender, RoutedEventArgs e )
{
	// When edit mode ends, the value will be committed and OriginalValue and
	// HasValueChanged will be reset.
	this.textEditor1.EndEditMode( true, false );

	this.textEditor1.Value = "A";

	// HasValueChanged and OriginalValue properties are only applicable during
	// edit mode. These properties are set when the value of the editor is
	// modified after entering edit mode.
	this.textEditor1.StartEditMode( );

	// The following will print out 'A' and False respectively.
	Debug.WriteLine( "After entering edit mode:" );
	Debug.WriteLine( "OriginalValue = '" + this.textEditor1.OriginalValue + "'" );
	Debug.WriteLine( "HasValueChanged = " + this.textEditor1.HasValueChanged );

	this.textEditor1.Value = "B";

	// The Value was modified to B above. The following will print out 'A' and 
	// True respectively.
	Debug.WriteLine( "After changing value to B:" );
	Debug.WriteLine( "OriginalValue = '" + this.textEditor1.OriginalValue + "'" );
	Debug.WriteLine( "HasValueChanged = " + this.textEditor1.HasValueChanged );

	// When edit mode ends, the value will be committed and HasValueChanged will 
	// be reset.
	this.textEditor1.EndEditMode( true, false );

	// The following will print out False.
	Debug.WriteLine( "After exiting edit mode:" );
	Debug.WriteLine( "HasValueChanged = " + this.textEditor1.HasValueChanged );
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also