InkOverlayStrokesDeletingEventArgs.StrokesToDelete, propriété
Mise à jour : November 2007
Obtient la collection Strokes supprimée lorsque l'événement StrokesDeleting se déclenche.
Espace de noms : Microsoft.Ink
Assembly : Microsoft.Ink (dans Microsoft.Ink.dll)
Syntaxe
'Déclaration
Public ReadOnly Property StrokesToDelete As Strokes
'Utilisation
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
Valeur de propriété
Type : Microsoft.Ink.Strokes
Collection Strokes supprimée lorsque l'événement StrokesDeleting se déclenche.
Exemples
Cet exemple montre comment s'abonner à l'événement StrokesDeleting pour restaurer le dernier trait supprimé.
Lorsque l'événement StrokesDeleting se déclenche, les objets Stroke qui vont être supprimés sont enregistrés.
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());
}
En réponse à une action utilisateur telle qu'un clic sur un MenuItem (page pouvant être en anglais), les objets Stroke supprimés précédemment sont de nouveau ajoutés à l'objet Ink d'origine.
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();
}
Plateformes
Windows Vista
Le .NET Framework et le .NET Compact Framework ne prennent pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Informations de version
.NET Framework
Pris en charge dans : 3.0
Voir aussi
Référence
InkOverlayStrokesDeletingEventArgs, classe