IncrementalLassoHitTester.SelectionChanged 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
套索路徑選取或取消選取筆墨 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
事件類型
範例
下列範例示範如何在自訂控制項中動態選取筆劃。 如需整個範例,請參閱 如何:從自訂控制項選取筆跡
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