IncrementalLassoHitTester.SelectionChanged 事件

定义

当套索路径选择或取消选择墨迹 Stroke 时发生。

public:
 event System::Windows::Ink::LassoSelectionChangedEventHandler ^ SelectionChanged;
public event System.Windows.Ink.LassoSelectionChangedEventHandler SelectionChanged;
member this.SelectionChanged : System.Windows.Ink.LassoSelectionChangedEventHandler 
Public Custom Event SelectionChanged As LassoSelectionChangedEventHandler 
Public Event SelectionChanged As LassoSelectionChangedEventHandler 

事件类型

LassoSelectionChangedEventHandler

示例

以下示例演示如何在自定义控件中动态选择笔划。 有关整个示例,请参阅 如何:从自定义控件中选择墨迹

void selectionTester_SelectionChanged(object sender,
    LassoSelectionChangedEventArgs args)
{
    // Change the color of all selected strokes to red.
    foreach (Stroke selectedStroke in args.SelectedStrokes)
    {
        selectedStroke.DrawingAttributes.Color = Colors.Red;
        selectedStrokes.Add(selectedStroke);
    }

    // Change the color of all unselected strokes to 
    // their original color.
    foreach (Stroke unselectedStroke in args.DeselectedStrokes)
    {
        unselectedStroke.DrawingAttributes.Color = inkDA.Color;
        selectedStrokes.Remove(unselectedStroke);
    }
}
Private Sub selectionTester_SelectionChanged(ByVal sender As Object, _
    ByVal args As LassoSelectionChangedEventArgs)

    ' Change the color of all selected strokes to red.
    For Each selectedStroke As Stroke In args.SelectedStrokes
        selectedStroke.DrawingAttributes.Color = Colors.Red
        selectedStrokes.Add(selectedStroke)
    Next selectedStroke

    ' Change the color of all unselected strokes to 
    ' their original color.
    For Each unselectedStroke As Stroke In args.DeselectedStrokes
        unselectedStroke.DrawingAttributes.Color = inkDA.Color
        selectedStrokes.Remove(unselectedStroke)
    Next unselectedStroke

End Sub

适用于