Files
docs-desktop/dotnet-desktop-guide/framework/wpf/advanced/how-to-erase-ink-on-a-custom-control.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

20 lines
1.2 KiB
Markdown

---
title: "How to: Erase Ink on a Custom Control"
ms.date: "03/30/2017"
dev_langs:
- "csharp"
- "vb"
helpviewer_keywords:
- "custom controls [WPF], erasing ink on"
- "ink [WPF], erasing on custom control"
ms.assetid: d88c50f9-b4d8-4962-a28b-67d6a15a5fe0
---
# How to: Erase Ink on a Custom Control
The <xref:System.Windows.Ink.IncrementalStrokeHitTester> determines whether the currently drawn stroke intersects another stroke. This is useful for creating a control that enables a user to erase parts of a stroke, the way a user can on an <xref:System.Windows.Controls.InkCanvas> when the <xref:System.Windows.Controls.InkCanvas.EditingMode%2A> is set to <xref:System.Windows.Controls.InkCanvasEditingMode.EraseByPoint>.
## Example
The following example creates a custom control that enables the user to erase parts of strokes. This example creates a control that contains ink when it is initialized. To create a control that collects ink, see [Creating an Ink Input Control](creating-an-ink-input-control.md).
[!code-csharp[HowToEraseInk#1](~/samples/snippets/csharp/VS_Snippets_Wpf/HowToEraseInk/CSharp/InkEraser.cs#1)]
[!code-vb[HowToEraseInk#1](~/samples/snippets/visualbasic/VS_Snippets_Wpf/HowToEraseInk/VisualBasic/InkEraser.vb#1)]