Export (0) Print
Expand All

InkOverlay.EditingMode Property

Gets or sets a value that indicates whether the InkOverlay is in ink mode, deletion mode, or selecting/editing mode.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

[BrowsableAttribute(true)]
public InkOverlayEditingMode EditingMode { get; set; }

Property Value

Type: Microsoft.Ink.InkOverlayEditingMode
One of the InkOverlayEditingMode values indicating whether the InkOverlay is in ink mode, delete mode, or select/edit mode.

An exception is raised if you change the EditingMode property while ink is being collected. To avoid this conflict, make sure the CollectingInk property is false before changing the EditingMode property.

For more information about erasing ink, see Erasing Ink with the Pen.

This example shows an event handler for a ListBox control that changes the EditingMode property for an InkOverlay object.

The EditingMode property cannot be changed while the object is collecting ink. Because ink collection is handled on a separate thread from your application code, the CollectingInk property can change to true while your application code is operating under the assumption that it is still false. To handle this contingency, access to the EditingMode property should be contained within a try-catch block.

// SelectedIndexChanged event handler for a list box with 3 mode choices: 
//  Ink     (index:0) 
//  Erase   (index:1) 
//  Select  (index:2) 
private void listBoxEditMode_SelectedIndexChanged(object sender, EventArgs e)
{
    try
    {
        // mInkObject can be InkOverlay or InkPicture 
        if (!mInkObject.CollectingInk)
        {
            switch (((ListBox)sender).SelectedIndex)
            {
                case 0:
                    mInkObject.EditingMode = InkOverlayEditingMode.Ink;
                    break;
                case 1:
                    mInkObject.EditingMode = InkOverlayEditingMode.Delete;
                    break;
                case 2:
                    mInkObject.EditingMode = InkOverlayEditingMode.Select;
                    break;
            }
        }
    }
    catch
    {
        // handle or rethrow
    }
}

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft