InkCanvas.Select 方法

定義

選取一組筆墨 Stroke 物件及/或 FrameworkElement 物件。

多載

Select(IEnumerable<UIElement>)

選取一組 UIElement 物件。

Select(StrokeCollection)

選取一組筆墨 Stroke 物件。

Select(StrokeCollection, IEnumerable<UIElement>)

選取 StrokeUIElement 物件的組合。

備註

InkCanvas可以包含 Stroke 物件,這些物件是用來回應使用者手寫筆輸入,以及 FrameworkElement 物件,例如 ImageButton 物件。

選取的筆劃將會以裝飾項顯示,以方便辨識和操作。 FrameworkElement 選取時,物件不會以不同方式顯示。

Select(IEnumerable<UIElement>)

選取一組 UIElement 物件。

public:
 void Select(System::Collections::Generic::IEnumerable<System::Windows::UIElement ^> ^ selectedElements);
public void Select (System.Collections.Generic.IEnumerable<System.Windows.UIElement> selectedElements);
member this.Select : seq<System.Windows.UIElement> -> unit
Public Sub Select (selectedElements As IEnumerable(Of UIElement))

參數

selectedElements
IEnumerable<UIElement>

要選取之 UIElement 物件的集合。

範例

下列範例會選取 上的所有筆劃和兩個專案 InkCanvas 。 這個範例假設有一個稱為 textbox1 的 和 Buttonbutton1 而且這兩個 TextBox 控制項都是 的 InkCanvas 子項目。

inkCanvas1.Select(inkCanvas1.Strokes, new UIElement[] { textbox1, button1 });
inkCanvas1.Select(inkCanvas1.Strokes, New UIElement() {textbox1, button1})

備註

InkCanvas可以包含 Stroke 物件,這些物件是為了回應使用者手寫筆輸入和 UIElement 物件而建立,例如 ImageButton 物件。

選取的筆劃會以裝飾項顯示,方便辨識和操作。 UIElement 選取時,物件不會以不同方式顯示。 UIElement如果 中的 selectedElements 不在 Children 集合中, Select 則會 UIElement 忽略 。

適用於

Select(StrokeCollection)

選取一組筆墨 Stroke 物件。

public:
 void Select(System::Windows::Ink::StrokeCollection ^ selectedStrokes);
public void Select (System.Windows.Ink.StrokeCollection selectedStrokes);
member this.Select : System.Windows.Ink.StrokeCollection -> unit
Public Sub Select (selectedStrokes As StrokeCollection)

參數

selectedStrokes
StrokeCollection

要選取之 Stroke 物件的集合。

例外狀況

selectedStrokes 中有一或多個筆劃不在 Strokes 屬性中。

範例

下列範例會選取 上的所有筆劃和兩個專案 InkCanvas 。 這個範例假設有一個稱為 textbox1 的 和 Buttonbutton1 而且這兩個 TextBox 控制項都是 的 InkCanvas 子項目。

inkCanvas1.Select(inkCanvas1.Strokes, new UIElement[] { textbox1, button1 });
inkCanvas1.Select(inkCanvas1.Strokes, New UIElement() {textbox1, button1})

備註

InkCanvas可以包含 Stroke 物件,這些物件是用來回應使用者手寫筆輸入,以及 FrameworkElement 物件,例如 ImageButton 物件。

選取的筆劃會以裝飾項顯示,方便辨識和操作。 FrameworkElement 選取物件時不會以不同方式顯示。

適用於

Select(StrokeCollection, IEnumerable<UIElement>)

選取 StrokeUIElement 物件的組合。

public:
 void Select(System::Windows::Ink::StrokeCollection ^ selectedStrokes, System::Collections::Generic::IEnumerable<System::Windows::UIElement ^> ^ selectedElements);
public void Select (System.Windows.Ink.StrokeCollection selectedStrokes, System.Collections.Generic.IEnumerable<System.Windows.UIElement> selectedElements);
member this.Select : System.Windows.Ink.StrokeCollection * seq<System.Windows.UIElement> -> unit
Public Sub Select (selectedStrokes As StrokeCollection, selectedElements As IEnumerable(Of UIElement))

參數

selectedStrokes
StrokeCollection

要選取之 Stroke 物件的集合。

selectedElements
IEnumerable<UIElement>

要選取之 UIElement 物件的集合。

例外狀況

selectedStrokes 中有一或多個筆劃沒有包括在 Strokes 屬性中。

範例

下列範例會選取 上的所有筆劃和兩個專案 InkCanvas 。 這個範例假設有一個稱為 textbox1 的 和 Buttonbutton1 而且這兩個 TextBox 控制項都是 的 InkCanvas 子項目。

inkCanvas1.Select(inkCanvas1.Strokes, new UIElement[] { textbox1, button1 });
inkCanvas1.Select(inkCanvas1.Strokes, New UIElement() {textbox1, button1})

備註

InkCanvas可以包含 Stroke 物件,這些物件是為了回應使用者手寫筆輸入和 UIElement 物件而建立,例如 ImageButton 物件。

選取的筆劃將會以裝飾項顯示,以方便辨識和操作。 UIElement 選取時,物件不會以不同方式顯示。 UIElement如果 中的 selectedElements 不在 Children 集合中, Select 則會 UIElement 忽略 。

適用於