InkCanvas.GetSelectedStrokes Metodo

Definizione

Recupera un StrokeCollection che rappresenta selezionati oggetti Stroke su InkCanvas.

public:
 System::Windows::Ink::StrokeCollection ^ GetSelectedStrokes();
public System.Windows.Ink.StrokeCollection GetSelectedStrokes ();
member this.GetSelectedStrokes : unit -> System.Windows.Ink.StrokeCollection
Public Function GetSelectedStrokes () As StrokeCollection

Restituisce

L'insieme dei tratti selezionati.

Esempio

Nell'esempio seguente viene modificato il colore di ogni tratto selezionato in un InkCanvasoggetto .

StrokeCollection selectedStrokes = inkCanvas1.GetSelectedStrokes();

foreach (Stroke aStroke in selectedStrokes)
{
    aStroke.DrawingAttributes.Color = Colors.Red;
}
Dim selectedStrokes As StrokeCollection = inkCanvas1.GetSelectedStrokes()

Dim aStroke As Stroke
For Each aStroke In selectedStrokes
    aStroke.DrawingAttributes.Color = Colors.Red
Next aStroke

Commenti

Questo metodo restituisce Stroke solo oggetti. Per recuperare oggetti selezionati FrameworkElement , chiamare il GetSelectedElements metodo .

Se l'oggetto EditingMode è InkCanvas impostato su EditingMode, gli utenti possono selezionare Stroke oggetti e FrameworkElement oggetti. In alternativa, entrambi i tipi di oggetti possono essere selezionati usando il codice: chiamare semplicemente il Select metodo.

Si applica a

Vedi anche