InkCanvas.EditingMode Property


Gets or sets the user editing mode used by an active pointing device.

 property System::Windows::Controls::InkCanvasEditingMode EditingMode { System::Windows::Controls::InkCanvasEditingMode get(); void set(System::Windows::Controls::InkCanvasEditingMode value); };
public System.Windows.Controls.InkCanvasEditingMode EditingMode { get; set; }
member this.EditingMode : System.Windows.Controls.InkCanvasEditingMode with get, set
Public Property EditingMode As InkCanvasEditingMode

Property Value


The editing mode used when a pointing device (such as a tablet pen or mouse) is active.


The following example creates an application that uses the various types of editing modes on an InkCanvas.

public partial class Window1 : Window
    RadioButton inkEditingMode;
    RadioButton selectEditingMode;
    RadioButton eraseByStrokeEditingMode;
    RadioButton eraseByPointEditingMode;

    InkCanvas inkCanvas1;

    StackPanel stackPanel1;

    DockPanel root;

    public Window1()

    private void WindowLoaded(object sender, RoutedEventArgs e)
        root = new DockPanel();
        this.Content = root;

        stackPanel1 = new StackPanel();

        inkEditingMode = new RadioButton();
        inkEditingMode.Content = "Ink";
        inkEditingMode.Click += new RoutedEventHandler(inkEditingMode_Click);
        inkEditingMode.IsChecked = true;

        selectEditingMode = new RadioButton();
        selectEditingMode.Content = "Select";
        selectEditingMode.Click += new RoutedEventHandler(selectEditingMode_Click);

        eraseByStrokeEditingMode = new RadioButton();
        eraseByStrokeEditingMode.Content = "Erase by Stroke";
        eraseByStrokeEditingMode.Click += new RoutedEventHandler(eraseByStrokeEditingMode_Click);

        eraseByPointEditingMode = new RadioButton();
        eraseByPointEditingMode.Content = "Erase by Point";
        eraseByPointEditingMode.Click += new RoutedEventHandler(eraseByPointEditingMode_Click);

        inkCanvas1 = new InkCanvas();

    void eraseByPointEditingMode_Click(object sender, RoutedEventArgs e)
        inkCanvas1.EditingMode = InkCanvasEditingMode.EraseByPoint;

    void eraseByStrokeEditingMode_Click(object sender, RoutedEventArgs e)
        inkCanvas1.EditingMode = InkCanvasEditingMode.EraseByStroke;

    void selectEditingMode_Click(object sender, RoutedEventArgs e)
        inkCanvas1.EditingMode = InkCanvasEditingMode.Select;

    void inkEditingMode_Click(object sender, RoutedEventArgs e)
        inkCanvas1.EditingMode = InkCanvasEditingMode.Ink;
Class Window1
    Inherits Window

    Private inkEditingMode As RadioButton
    Private selectEditingMode As RadioButton
    Private eraseByStrokeEditingMode As RadioButton
    Private eraseByPointEditingMode As RadioButton
    Private inkCanvas1 As InkCanvas
    Private stackPanel1 As StackPanel
    Private root As DockPanel
    Public Sub New() 
    End Sub
    Private Sub WindowLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs) 

        root = New DockPanel()
        Me.Content = root

        stackPanel1 = New StackPanel()
        inkEditingMode = New RadioButton()
        inkEditingMode.Content = "Ink"
        AddHandler inkEditingMode.Click, AddressOf inkEditingMode_Click
        inkEditingMode.IsChecked = True
        selectEditingMode = New RadioButton()
        selectEditingMode.Content = "Select"
        AddHandler selectEditingMode.Click, AddressOf selectEditingMode_Click
        eraseByStrokeEditingMode = New RadioButton()
        eraseByStrokeEditingMode.Content = "Erase by Stroke"
        AddHandler eraseByStrokeEditingMode.Click, AddressOf eraseByStrokeEditingMode_Click
        eraseByPointEditingMode = New RadioButton()
        eraseByPointEditingMode.Content = "Erase by Point"
        AddHandler eraseByPointEditingMode.Click, AddressOf eraseByPointEditingMode_Click
        inkCanvas1 = New InkCanvas()
    End Sub
    Private Sub eraseByPointEditingMode_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)

        inkCanvas1.EditingMode = InkCanvasEditingMode.EraseByPoint

    End Sub
    Private Sub eraseByStrokeEditingMode_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)

        inkCanvas1.EditingMode = InkCanvasEditingMode.EraseByStroke

    End Sub
    Private Sub selectEditingMode_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)

        inkCanvas1.EditingMode = InkCanvasEditingMode.Select

    End Sub
    Private Sub inkEditingMode_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)

        inkCanvas1.EditingMode = InkCanvasEditingMode.Ink

    End Sub
End Class


The default EditingMode is Ink. Changing the EditingMode clears any existing selections.

The EditingMode specifies the mode of the pointing device as it interacts with the InkCanvas. EditingModeInverted is used by some digitizers when the "eraser end" of the stylus contacts the digitizer.

Dependency Property Information

Identifier field EditingModeProperty
Metadata properties set to true None

Applies to

See also