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


Ink.InkDeleted - событие

Обновлен: Ноябрь 2007

Occurs when a Stroke object is deleted from the Ink object.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Event InkDeleted As StrokesEventHandler
'Применение
Dim instance As Ink
Dim handler As StrokesEventHandler

AddHandler instance.InkDeleted, handler
public event StrokesEventHandler InkDeleted
public:
 event StrokesEventHandler^ InkDeleted {
    void add (StrokesEventHandler^ value);
    void remove (StrokesEventHandler^ value);
}
/** @event */
public void add_InkDeleted (StrokesEventHandler value)
/** @event */
public void remove_InkDeleted (StrokesEventHandler value)
JScript не поддерживает события.

Заметки

The event handler receives an argument of type StrokesEventArgs that contains data about this event.

When you create a StrokesEventHandler delegate, you identify the method that handles the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

If you use the InkOverlay object or the InkPicture control (where EditingMode equals Delete and EraserMode equals StrokeErase) and pass the eraser over a stroke, you get the following sequence of events:

  1. InkDeleted

  2. InkAdded

  3. InkDeleted

The additional InkAdded and InkDeleted events occur because the underlying code adds an internal, invisible stroke to track the eraser.

The InkDeleted event fires even when in select mode, not only when in delete mode. This requires that you monitor the editing mode (which you are responsible for setting) and be aware of the mode before interpreting the event. The advantage of this requirement is greater freedom to innovate on the platform through greater awareness of platform events.

Примеры

In this example an InkDeleted event handler writes information about the deleted strokes to a list box control.

Private Sub Ink_InkDeleted(ByVal sender As Object, ByVal e As StrokesEventArgs)
    ' since this event fires in select mode also, we will check EditingMode
    ' and examine the StrokeIds only if we are currently in mode: InkOverlayEditingMode.Delete 
    If InkOverlayEditingMode.Delete = Me.mInkOverlay.EditingMode Then
        For Each id As Integer In e.StrokeIds
            Me.listBoxStrokeId.Items.Add("Deleted ID:" + id.ToString())
        Next
    End If
End Sub
private void Ink_InkDeleted(object sender, StrokesEventArgs e)
{
    // since this event fires in select mode also, we will check EditingMode
    // and examine the StrokeIds only if we are currently in mode: InkOverlayEditingMode.Delete 
    if (InkOverlayEditingMode.Delete == this.mInkOverlay.EditingMode)
    {
        foreach (int id in e.StrokeIds)
        {
            this.listBoxStrokeId.Items.Add("Deleted ID:" + id.ToString());

        }
    }
}

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

Ink Класс

Ink - члены

Microsoft.Ink - пространство имен

Ink.InkAdded

InkOverlay.EditingMode

InkOverlay.EraserMode

InkPicture.EditingMode

InkPicture.EraserMode

InkOverlay.StrokesDeleting

InkOverlay.StrokesDeleted

InkPicture.StrokesDeleting

InkPicture.StrokesDeleted

Stroke