다음을 통해 공유


InkOverlayStrokesDeletingEventArgs.StrokesToDelete 속성

업데이트: 2007년 11월

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