Share via


InkOverlaySelectionChangingEventArgs.NewSelection Property

InkOverlaySelectionChangingEventArgs.NewSelection Property

Gets the new Strokes collection for a InkOverlaySelectionChangingEventArgs event.

Definition

Visual Basic .NET Public ReadOnly Property NewSelection As Strokes
C# public Strokes NewSelection { get; }
Managed C++ public: __property Strokes* get_NewSelection();

Property Value

Microsoft.Ink.Strokes. The new Strokes collection.

This property is read-only. This property has no default value.

Examples

[C#]

This C# example adds a SelectionChanging event hander, theInkOverlay_SelectionChanging, to an InkOverlay, theInkOverlay. Before the selection actually occurs, the colors of the selected strokes are painted red. (Note that this permanently turns the selected strokes red.)

using Microsoft.Ink;
//...
  theInkOverlay.SelectionChanging += new InkOverlaySelectionChangingEventHandler(theInkOverlay_SelectionChanging);
//...
  private void theInkOverlay_SelectionChanging(object sender, InkOverlaySelectionChangingEventArgs e)
  {
     foreach (Stroke selectedStroke in e.NewSelection)
     {
         selectedStroke.DrawingAttributes.Color = Color.Red;
     }
  }
//...

[Visual Basic .NET]

This Microsoft® Visual Basic® .NET example adds a SelectionChanging event hander, theInkOverlay_SelectionChanging, to an InkOverlay, theInkOverlay. Before the selection actually occurs, the colors of the selected strokes are painted red. (Note that this permanently turns the selected strokes red.)

Imports Microsoft.Ink
'...
    Private WithEvents theInkOverlay As InkOverlay
'...
    Private Sub theInkOverlay_SelectionChanging(ByVal sender As Object, _
        ByVal e As Microsoft.Ink.InkOverlaySelectionChangingEventArgs) _
    Handles theInkOverlay.SelectionChanging
        Dim selectedStroke As Stroke
        For Each selectedStroke In e.NewSelection
            selectedStroke.DrawingAttributes.Color = Color.Red
        Next
    End Sub
'...

See Also