InkCanvas.StrokeErasing 이벤트

정의

사용자가 스트로크를 지우기 직전에 발생합니다.Occurs just before a user erases a stroke.

public:
 event System::Windows::Controls::InkCanvasStrokeErasingEventHandler ^ StrokeErasing;
public event System.Windows.Controls.InkCanvasStrokeErasingEventHandler StrokeErasing;
member this.StrokeErasing : System.Windows.Controls.InkCanvasStrokeErasingEventHandler 
Public Custom Event StrokeErasing As InkCanvasStrokeErasingEventHandler 
Public Event StrokeErasing As InkCanvasStrokeErasingEventHandler 

이벤트 유형

InkCanvasStrokeErasingEventHandler

예제

다음 예제에서는 형광펜으로 렌더링 된 모든 스트로크를 지울 수 없도록 합니다.The following example prevents any strokes rendered as highlighters from being erased. 이 예제에서는 InkCanvas 가 이벤트 처리기에 연결 된 것으로 가정 합니다.The example assumes that the InkCanvas is connected to the event handler.

void inkCanvas1_StrokeErasing(object sender, InkCanvasStrokeErasingEventArgs e)
{
    if (e.Stroke.DrawingAttributes.IsHighlighter)
    {
        e.Cancel = true;
    }
}
Private Sub inkCanvas1_StrokeErasing(ByVal sender As Object, _
                             ByVal e As InkCanvasStrokeErasingEventArgs)

    If (e.Stroke.DrawingAttributes.IsHighlighter) Then
        e.Cancel = True

    End If
End Sub

설명

스트로크를 지워야 하는지 여부를 확인 하려면이 이벤트를 처리 합니다.Handle this event when you want to check whether a stroke should be erased. 스트로크를 Cancel 지울 수 없도록 하려면 속성을로 설정 합니다 true .Set the Cancel property to true if you want to prevent the stroke from being erased. EditingMode또는 EditingModeInverted 속성이 또는로 설정 된 경우이 방법을 사용할 수 있습니다 EraseByStroke EraseByPoint .You can use this technique when the EditingMode or EditingModeInverted property is set to EraseByStroke or EraseByPoint.

적용 대상