FrameworkElement.FindName(String) FrameworkElement.FindName(String) FrameworkElement.FindName(String) FrameworkElement.FindName(String) Method

定義

尋找具有所提供之識別項名稱的項目。Finds an element that has the provided identifier name.

public:
 System::Object ^ FindName(System::String ^ name);
public object FindName (string name);
member this.FindName : string -> obj
Public Function FindName (name As String) As Object

參數

name
String String String String

要求之項目的名稱。The name of the requested element.

傳回

要求的項目。The requested element. 如果找不到相符的項目,這可能會是 nullThis can be null if no matching element was found.

備註

如果專案具有子專案, 則會以遞迴方式針對要求的已命名專案搜尋這些子專案。If the element has child elements, these child elements are all searched recursively for the requested named element.

FindName在目前元素的名稱範圍內運作。FindName operates within the current element's namescope. 如需詳細資訊, 請參閱WPF XAML 名稱範圍For details, see WPF XAML Namescopes.

適用於

另請參閱