InkOverlayStrokesDeletingEventArgs.StrokesToDelete 属性

获取激发 StrokesDeleting 事件时删除的 Strokes 集合。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public ReadOnly Property StrokesToDelete As Strokes
用法
Dim instance As InkOverlayStrokesDeletingEventArgs
Dim value As Strokes

value = instance.StrokesToDelete
public Strokes StrokesToDelete { get; }
public:
property Strokes^ StrokesToDelete {
    Strokes^ get ();
}
/** @property */
public Strokes get_StrokesToDelete()
public function get StrokesToDelete () : Strokes

属性值

类型:Microsoft.Ink.Strokes
激发 StrokesDeleting 事件时删除的 Strokes 集合。

示例

此示例演示如何订阅 StrokesDeleting 事件,以使您能够还原最后一个删除的笔画。

激发 StrokesDeleting 事件时,将保存即将删除的 Stroke 对象。

Private Sub mInkObject_StrokesDeleting(ByVal sender As Object, ByVal e As InkOverlayStrokesDeletingEventArgs)
    ' Store strokes for later undo. They must be stored in
    ' a separate Ink object. 
    mInkDeleted = New Ink()
    mInkDeleted.AddStrokesAtRectangle(e.StrokesToDelete, e.StrokesToDelete.GetBoundingBox())
End Sub
private void mInkObject_StrokesDeleting(object sender, InkOverlayStrokesDeletingEventArgs e)
{
    // Store strokes for later undo. They must be stored in
    // a separate Ink object. 
    mInkDeleted = new Ink();
    mInkDeleted.AddStrokesAtRectangle(e.StrokesToDelete, e.StrokesToDelete.GetBoundingBox());
}

为响应用户操作(比如单击 MenuItem),以前删除的 Stroke 对象将添加回原始 Ink 对象。

If Not mInkDeleted Is Nothing Then
    ' Add strokes back.  (You need to use Ink.AddStrokesAtRectangle as opposed
    ' to Strokes.Add because you are dealing with two different Ink objects.)
    mInkObject.Ink.AddStrokesAtRectangle(mInkDeleted.Strokes, mInkDeleted.Strokes.GetBoundingBox())
    mInkDeleted = Nothing
    ' For best performance, you should Invalidate the rectangle created by the 
    ' bounding box (converted from ink space to pixel space).  For simplicity,
    ' we will just refresh the entire control.
    Refresh()
End If
if (mInkDeleted != null)
{
    // Add strokes back.  (You need to use Ink.AddStrokesAtRectangle as opposed
    // to Strokes.Add because you are dealing with two different Ink objects.)
    mInkObject.Ink.AddStrokesAtRectangle(mInkDeleted.Strokes, mInkDeleted.Strokes.GetBoundingBox());
    mInkDeleted = null;
    // For best performance, you should Invalidate the rectangle created by the 
    // bounding box (converted from ink space to pixel space).  For simplicity,
    // we will just refresh the entire control.
    Refresh();
}

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkOverlayStrokesDeletingEventArgs 类

InkOverlayStrokesDeletingEventArgs 成员

Microsoft.Ink 命名空间

InkOverlay

InkOverlay.StrokesDeleting

AddStrokesAtRectangle