Поделиться через


InkOverlay.EditingMode Property

InkOverlay.EditingMode Property

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

Definition

Visual Basic .NET Public Property EditingMode As InkOverlayEditingMode
C# public InkOverlayEditingMode EditingMode { get; set; }
Managed C++ public: __property InkOverlayEditingMode* get_EditingMode();
public: __property void set_EditingMode(InkOverlayEditingMode*);

Property Value

Microsoft.Ink.InkOverlayEditingMode. Whether the InkOverlay is in ink mode, delete mode, or select/edit mode.

This property is read/write. This property has no default value.

Ink0 Specifies the object or control is in collection mode.
Delete1 Specifies the object or control is in deletion mode.
Select2 Specifies the object or control is in selection and editing mode.

Exceptions

COMException Leave Site:
ObjectDisposedException Leave Site:

Remarks

An error is generated 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.

Examples

[C#]

This C# example shows functions that are called when menu items are clicked in order to change the editing mode of an InkOverlay, theInkOverlay.

private void menuItemInk_Click(object sender, System.EventArgs e)
{
    if (!theInkOverlay.CollectingInk)
    {
        theInkOverlay.EditingMode = InkOverlayEditingMode.Ink;
        menuItemInk.Checked = true;
        menuItemDelete.Checked = false;
        menuItemSelect.Checked = false;
    }
    else
    {
        // Unlikely to happen, but check anyway
        MessageBox.Show("Cannot change modes while collecting ink");
    }
}

private void menuItemDelete_Click(object sender, System.EventArgs e)
{
    if (!theInkOverlay.CollectingInk)
    {
        theInkOverlay.EditingMode = InkOverlayEditingMode.Delete;
        menuItemInk.Checked = false;
        menuItemDelete.Checked = true;
        menuItemSelect.Checked = false;
    }
    else
    {
        // Unlikely to happen, but check anyway
        MessageBox.Show("Cannot change modes while collecting ink");
    }
}

private void menuItemSelect_Click(object sender, System.EventArgs e)
{
    if (!theInkOverlay.CollectingInk)
    {
        theInkOverlay.EditingMode = InkOverlayEditingMode.Select;
        menuItemInk.Checked = false;
        menuItemDelete.Checked = false;
        menuItemSelect.Checked = true;
    }
    else
    {
        // Unlikely to happen, but check anyway
        MessageBox.Show("Cannot change modes while collecting ink");
    }
}
            

[VB.NET]

This Microsoft® Visual Basic® .NET example shows functions that are called when menu items are clicked in order to change the editing mode of an InkOverlay, theInkOverlay.

Imports Microsoft.Ink
'...
Private Sub MenuItemInk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MenuItemInk.Click
    If theInkOverlay.CollectingInk = False Then
        theInkOverlay.EditingMode = InkOverlayEditingMode.Ink
        MenuItemInk.Checked = True
        MenuItemDelete.Checked = False
        MenuItemSelect.Checked = False
    Else
        'Unlikely to happen, but check anyway
        MessageBox.Show("Cannot change modes while collecting ink")
    End If
End Sub

Private Sub MenuItemDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MenuItemDelete.Click
    If theInkOverlay.CollectingInk = False Then
        theInkOverlay.EditingMode = InkOverlayEditingMode.Delete
        MenuItemInk.Checked = False
        MenuItemDelete.Checked = True
        MenuItemSelect.Checked = False
    Else
        'Unlikely to happen, but check anyway
        MessageBox.Show("Cannot change modes while collecting ink")
    End If
End Sub

Private Sub MenuItemSelect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MenuItemSelect.Click
    If theInkOverlay.CollectingInk = False Then
        theInkOverlay.EditingMode = InkOverlayEditingMode.Select
        MenuItemInk.Checked = False
        MenuItemDelete.Checked = False
        MenuItemSelect.Checked = True
    Else
        'Unlikely to happen, but check anyway
        MessageBox.Show("Cannot change modes while collecting ink")
    End If
End Sub
        

See Also