共用方式為


InkCanvas.StrokeErasing 事件

定義

正好在使用者擦掉筆劃之前發生。

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

範例

下列範例可防止任何轉譯為醒目提示的筆劃遭到清除。 此範例假設 InkCanvas 已連接到事件處理常式。

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

備註

當您想要檢查是否應該清除筆劃時,請處理此事件。 如果您想要防止清除筆劃,請將 Cancel 屬性 true 設定為 。 當 或 EditingModeInverted 屬性設定為 EraseByStrokeEraseByPoint 時, EditingMode 您可以使用這項技術。

適用於